public async Task Update(Contractor item) { using (var dataContext = new ContractorsDataContext()) { dataContext.Entry(item).State = EntityState.Modified; await dataContext.SaveChangesAsync(); } }
public async Task Add(Contractor item) { using (var dataContext = new ContractorsDataContext()) { dataContext.Contractors.Add(item); await dataContext.SaveChangesAsync(); } }