public static Goal Copy(Goal existingGoal, Goal editedGoal) { var goalService = new GoalProgressService(); var period = new Period(existingGoal.Start, editedGoal.End); var progressPerMinute = goalService.ProgressPerminute(period, editedGoal.Amount); editedGoal.Id = existingGoal.Id; editedGoal.ProgressPerMinute = progressPerMinute; editedGoal.Start = existingGoal.Start; return(editedGoal); }
public static Goal Create(decimal amount, DateTime dateTime, string imageUri, string name) { var goalService = new GoalProgressService(); var period = new Period(DateTime.Now, dateTime); var progressPerMinute = goalService.ProgressPerminute(period, amount); return(new Goal { Id = Guid.NewGuid(), Amount = amount, End = dateTime, Image = imageUri, Name = name, Start = DateTime.Now, ProgressPerMinute = progressPerMinute }); }