Exemple #1
0
        public static bool Commit()
        {
            try
            {
                EntityDb <T> .CommitChanges();

                EntityDb <T> .CloseSession();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public static List <T> GetEntities(Func <T, bool> query)
        {
            try
            {
                List <T> results = new List <T>();
                results = EntityDb <T> .GetByLinqQuery(query);

                EntityDb <T> .CloseSession();

                return(results);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #3
0
        public static List <T> PagedGetAllEntities(int start, int pageSize, out int totalCount)
        {
            try
            {
                List <T> results = new List <T>();
                results = EntityDb <T> .PagedGetAll(start, pageSize, out totalCount);

                EntityDb <T> .CloseSession();

                return(results);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #4
0
        public static List <T> GetAllEntities()
        {
            try
            {
                List <T> results = new List <T>();
                results = EntityDb <T> .GetAll();

                EntityDb <T> .CloseSession();

                return(results);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #5
0
        public static List <T> PagedGetEntities(System.Linq.Expressions.Expression <Func <T, bool> > query, int start, int pageSize, out int totalCount)
        {
            try
            {
                List <T> results = new List <T>();
                results = EntityDb <T> .PagedGetByLinqQuery(query, start, pageSize, out totalCount);

                EntityDb <T> .CloseSession();

                return(results);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #6
0
        public static bool EditEntity(T entity)
        {
            try
            {
                EntityDb <T> .SaveOrUpdate(entity);

                EntityDb <T> .CommitChanges();

                EntityDb <T> .CloseSession();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }