//private readonly Student student; public StudentRepository(UniversityDBcontext universityDBcontext) { univDB = universityDBcontext; //studentlist = new List<Student>() //{ // new Student() { Id = 1, Name = "Mary", Gender = "Female",Department = "HR"}, // new Student() { Id = 2, Name = "John", Department = "IT", Gender = "Male" }, // new Student() { Id = 3, Name = "Sam", Department = "IT", Gender = "Male" }, //}; }
static void nmain(string[] args) { using (var context = new UniversityDBcontext()) { var std = new Student() { Name = "Bill" }; context.Students.Add(std); context.SaveChanges(); } }
public CreateModel(TryCSharp.FirstApi.Repositories.UniversityDBcontext context) { _context = context; }
public DepartmentRepository(UniversityDBcontext universityDBcontext) { univDB = universityDBcontext; }