public async Task <int> CreateAsync(OperationalCostModel model) { do { model.Code = CodeGenerator.Generate(); }while (DbSet.Any(d => d.Code.Equals(model.Code))); OperationalCostLogic.CreateModel(model); return(await DbContext.SaveChangesAsync()); }
public async Task <int> UpdateAsync(int id, OperationalCostModel model) { await OperationalCostLogic.UpdateModelAsync(id, model); return(await DbContext.SaveChangesAsync()); }