public void Add(string Name, int Score, int?Age = null) { var newTest = new TestsHistory { Name = Name, Score = Score, Age = Age, }; using (var context = new TestContext()) { context.TestsHistory.Add(newTest); context.SaveChanges(); } }
public void Add(string Name, int Score, Rating Fitness_Rating) { var newTest = new TestsHistory { Name = Name, Aerobic_Capacity = Score, Fitness_Rating = Fitness_Rating, Date = DateTime.Now }; using (var context = new DatabaseContext()) { context.TestsHistory.Add(newTest); context.SaveChanges(); } }