Juicy
Juicy
Explore posts from servers
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
alternatively had to manually insert by calling DbContext.Add but since I handle the id creations myself I just set the .ValueGeneratedNever and now it seems to work fine
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
so I had to add a .ValueGeneratedNever()
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
Value generation was turned on even though I set the Id property manually on creation
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
Well I found the cause
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
but still same
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
I tried to drop the database and have EF core re create it
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
i have no clue how to find the issue 😭
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
could it be the way i configured the table?
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
damn
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
yeah I just get it like this
public async Task<User?> GetByIdAsync(Guid productId, Guid id, CancellationToken cancellationToken = default)
{
return await dbContext.Set<User>()
.Include(u => u.Licenses)
.Include(u => u.Machine)
.Include(u => u.Variables)
.FirstOrDefaultAsync(u => u.ProductId == productId && u.Id == id, cancellationToken);
}
public async Task<User?> GetByIdAsync(Guid productId, Guid id, CancellationToken cancellationToken = default)
{
return await dbContext.Set<User>()
.Include(u => u.Licenses)
.Include(u => u.Machine)
.Include(u => u.Variables)
.FirstOrDefaultAsync(u => u.ProductId == productId && u.Id == id, cancellationToken);
}
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
ah
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
how can I check if its handled by change tracker btw?
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
but in this case I thought it would be unnecessary
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
so I just add it via reposistory before adding it to another model's collection
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
In the other cases I have repositories for every model that im working with
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
I honestly have no clue what it could be
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
i see
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
so I need to insert the userVariable to it's table before I add it to the user collection
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
but thats weird
62 replies
CC#
Created by Juicy on 4/26/2025 in #help
DbConcurrencyException, what am I missing?
ah
62 replies