Example #1
0
 //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" },
     //};
 }
Example #2
0
        static void nmain(string[] args)
        {
            using (var context = new UniversityDBcontext())
            {
                var std = new Student()
                {
                    Name = "Bill"
                };

                context.Students.Add(std);
                context.SaveChanges();
            }
        }
Example #3
0
 public CreateModel(TryCSharp.FirstApi.Repositories.UniversityDBcontext context)
 {
     _context = context;
 }
Example #4
0
 public DepartmentRepository(UniversityDBcontext universityDBcontext)
 {
     univDB = universityDBcontext;
 }