public void EditBudget(BillsData.Budget budget) { budget.ModyficationDate = DateTime.Now; context.Update(budget); // var createDate = context.Budgets.FirstOrDefault(a => a.Id == id).CreateDate; // budget.CreateDate = createDate; context.SaveChangesAsync(); }
public void Add(BillsData.Budget budget) { budget.CreateDate = DateTime.Now; budget.ModyficationDate = DateTime.Now; budget.UserId = GetCurrentUserId(); context.Add(budget); context.SaveChanges(); }