예제 #1
0
        public Task <int> InsertAsync(GarmentShippingInvoiceAdjustmentModel model)
        {
            model.FlagForCreate(_identityProvider.Username, USER_AGENT);

            _dbSet.Add(model);

            return(_dbContext.SaveChangesAsync());
        }
예제 #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());
        }