Exemple #1
0
        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());
        }
Exemple #2
0
        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());
        }