public async Task <bool> AddAsync(core.Cost cost) { if (await CostExists(cost.UNITID)) { return(false); } var newCost = cost.ToDataObject(); _context.Cost.Add(newCost); return(_context.ChangeTracker.HasChanges()); }
public async Task <bool> UpdateAsync(core.Cost Cost) { if (!await CostExists(Cost.UNITID)) { return(false); } var upCost = Cost.ToDataObject(); _context.Cost.Update(upCost); _context.Update(upCost); return(_context.ChangeTracker.HasChanges()); }