Update x gestione metodi upsert

This commit is contained in:
Samuele Locatelli
2026-03-23 17:17:31 +01:00
parent 84144b4beb
commit 8c957edad8
31 changed files with 574 additions and 194 deletions
@@ -46,21 +46,19 @@ namespace EgwCoreLib.Lux.Data.Repository.Config
await using var dbCtx = await CreateContextAsync();
return await dbCtx.DbSetConfProfile
.FirstOrDefaultAsync(x => x.ProfileID == recId);
//.Where(x => x.ProfileID == recId)
}
public async Task<ProfileModel?> GetByUidAsync(string uID)
{
await using var dbCtx = await CreateContextAsync();
return await dbCtx.DbSetConfProfile
.FirstOrDefaultAsync(x => x.Code == uID);
//.FirstOrDefaultAsync();
}
public async Task<bool> UpdateAsync(ProfileModel entity)
{
await using var dbCtx = await CreateContextAsync();
var trackedEntity = dbCtx.DbSetConfProfile.Local.FirstOrDefault(x => x.ProfileID == entity.ProfileID);
var trackedEntity = await dbCtx.DbSetConfProfile.FirstOrDefaultAsync(x => x.ProfileID == entity.ProfileID);
if (trackedEntity != null)
{