public CoursesController(_IGenericRepo <Course> Courseobj) { _Courseobj = Courseobj; }
//public EnrollmentsController() : this (new GenericRepo<Enrollment>()) //{ //} public EnrollmentsController(_IGenericRepo <Enrollment> Eobj) { dbentity = new ProjectDataEntities(); _Eobj = Eobj; }
private _IGenericRepo <Student> Sobj; //declare the object of interface of _IGenericRepo public StudentsController() //Constructor to initiate the object of interface with GenericRepo Class to implement its methods. { Sobj = new GenericRepo <Student>(); }
private _IGenericRepo <Course> Cobj; //declare the object of interface of _IGenericRepo public CoursesController() //Constructor to initiate the object of interface with GenericRepo Class to implement its methods. { Cobj = new GenericRepo <Course>(); }
private ProjectDataEntities _context; //declare the object of the database to get access the members of Course and Student table. public EnrollmentsController() { Eobj = new GenericRepo <Enrollment>(); _context = new ProjectDataEntities(); }