Exemplo n.º 1
0
        public Task <int> InsertAsync(GarmentShippingInvoiceAdjustmentModel model)
        {
            model.FlagForCreate(_identityProvider.Username, USER_AGENT);

            _dbSet.Add(model);

            return(_dbContext.SaveChangesAsync());
        }
Exemplo n.º 2
0
        public Task <int> UpdateAsync(int id, GarmentShippingInvoiceAdjustmentModel model)
        {
            var modelToUpdate = _dbSet
                                .FirstOrDefault(s => s.Id == id);

            modelToUpdate.SetAdjustmentDescription(model.AdjustmentDescription, _identityProvider.Username, USER_AGENT);
            modelToUpdate.SetAdjustmentValue(model.AdjustmentValue, _identityProvider.Username, USER_AGENT);

            return(_dbContext.SaveChangesAsync());
        }