Пример #1
0
        public CarExpense Update(CarExpense expenseChanges)
        {
            var carexpense = context.CarExpenses.Attach(expenseChanges);

            carexpense.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(expenseChanges);
        }
Пример #2
0
 public CarExpense Add(CarExpense expense)
 {
     context.CarExpenses.Add(expense);
     context.SaveChanges();
     return(expense);
 }