public async static Task Initialize(RepositoryContext context, IEnumerable <User> users) { await context.Database.MigrateAsync(); var userCount = await context.Users.CountAsync().ConfigureAwait(false); if (userCount == 0) { await context.Users.AddRangeAsync(users); await context.SaveChangesAsync().ConfigureAwait(false); } }
public async Task <ReturnResult> UpdateDepartment(Department department) { ReturnResult result; //try //{ var ExistDept = FindByCondition(x => x.Id == department.Id).AsNoTracking().FirstOrDefault(); if (ExistDept == null) { result = new ReturnResult() { Succeeded = false, Error = "Department Not Exist" }; } Update(department); int retVal = await RepositoryContext.SaveChangesAsync(); result = new ReturnResult() { Succeeded = true, Error = "" }; //} //catch (Exception x) //{ // result = new ReturnResult() // { // Succeeded = false, // Error = x.Message // }; //} return(result); }
public Task SaveAsync() => _repoContext.SaveChangesAsync();
public void SaveAsync() { _repoContext.SaveChangesAsync(); }
public async Task SaveAsync() { await _repoContext.SaveChangesAsync(); }
public async Task <bool> SaveAsync() { return(await _repositoryContext.SaveChangesAsync() > 0); }
public async Task <bool> SaveChargesAsync() { return((await _context.SaveChangesAsync()) > 0); }
public async Task <int> SaveChanges() { return(await _repositoryContext.SaveChangesAsync()); }
public Task SaveAsync() => _context.SaveChangesAsync();
public async Task DeleteOwnerAsync(Owner owner) { Delete(owner); await RepositoryContext.SaveChangesAsync(); }
public async Task Save() { await _repositoryContext.SaveChangesAsync(); }
public async Task SaveChangesAsync() { await _repositoryContext.SaveChangesAsync().ConfigureAwait(false); }
public async Task SaveChangesAsync() { await context.SaveChangesAsync(); }
public Task Save() => RepositoryContext.SaveChangesAsync();
public async Task SaveAsync() { await repository.SaveChangesAsync(); }
public async Task SaveAsync() { var result = await _repoContext.SaveChangesAsync(); }