public int Create(Core.Workout workout) { Workout entity = new Workout(); var newWorkout = db.Workouts.Add(entity); db.SaveChanges(); return(newWorkout.Id); }
public int Create(Excercise excercise) { var entity = new Exercise { Name = excercise.Name }; db.Exercises.Add(entity); db.SaveChanges(); return(entity.Id); }
public int Create(Core.Set set) { Set entity = new Set { //Workout = new Workout { Id = set.Workout.Id }, StartTime = DateTime.Now, FinishTime = DateTime.Now, Repetitions = "12", Weight = "100", Exercise = new Exercise { Id = set.Excercise.Id, Name = "Dumbell" } }; db.Sets.Add(entity); db.SaveChanges(); return(entity.Id); }