public void SaveFoodLogEntry(FoodLogEntry food) { if (food.Id == 0) { _context.FoodLogEntries.Add(food); } else { _context.Entry(food).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } }
public void SaveExercise(Exercise exercise) { if (exercise.Id == Guid.Empty) { _context.Exercises.Add(exercise); } else { _context.Entry(exercise).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } }