public void AddGoal(Goal goal) { var g = new Db.Entities.Goal { Name = goal.Name, DueDate = goal.DueDate, Amount = goal.Amount, ClientId = 1 }; _context.Goals.Add(g); _context.SaveChanges(); }
public void SetMainGoal(int id) { var goal = _context.Goals.Where(x => x.GoalId == id).First(); var ng = new Db.Entities.Goal { Name = goal.Name, DueDate = goal.DueDate, Amount = goal.Amount, ClientId = 1 }; DeleteGoal(id); _context.Goals.Add(ng); _context.SaveChanges(); }