Exemplo n.º 1
0
        public dynamic GetAll_Course()
        {
            GenericUnitOfWork uow = new EF_DbFirst.Repository.GenericUnitOfWork();
            var item = uow.Repository <T_COURSES>().GetAll();

            return(item);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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();
        }