Update x gestione metodi upsert
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user