public dynamic GetAll_Course() { GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork(); var item = uow.Repository <T_COURSES>().GetAll(); return(item); }
public static void AddCoures() { GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork(); uow.Repository <T_COURSES>().Add(new T_COURSES { Descriptions = "Basic operation12", Course_Name = "Course 12" }); uow.SaveChanges(); }
public string Manage_Course(HttpRequestMessage request, [FromBody] T_COURSES Entity) { GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork(); uow.Repository <T_COURSES>().Add(Entity); uow.SaveChanges(); return(string.Empty); }
public dynamic Fetch_Coures(HttpRequestMessage request, [FromBody] List <Filter> filters) { List <Filter> filter = new List <Filter>(); filter.Add(new Filter { PropertyName = "ID", Operation = Op.Equals, Value = 1 }); GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork(); var item = uow.Repository <T_COURSES>().FindAll(filter).FirstOrDefault(); return(item); }
public static void UpdateCoures() { List <Filter> filter = new List <Filter>(); filter.Add(new Filter { PropertyName = "ID", Operation = Op.Equals, Value = 1 }); GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork(); var item = uow.Repository <T_COURSES>().FindAll(filter).FirstOrDefault(); item.Course_Name = "Updated Coures 3"; item.Descriptions = "Updated 3"; uow.SaveChanges(); }