Continuo con Config e Cost
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -19,6 +20,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddRangeAsync(List<ProfileModel> entityList)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -26,24 +28,28 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
dbCtx.DbSetConfProfile.Remove(entity);
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task<List<ProfileModel>> GetAllAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetConfProfile.AsNoTracking().ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ProfileModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetConfProfile
|
||||
.FirstOrDefaultAsync(x => x.ProfileID == recId);
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task<ProfileModel?> GetByUidAsync(string uID)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -52,6 +58,7 @@
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
Reference in New Issue
Block a user