示例#1
0
 public List <T> GetAllData <T>(Expression <Func <T, bool> > conditions = null) where T : class, new()
 {
     using (IDbContextBase context = DbContextFactory.GetDbContext())
     {
         return(context.FindAll <T>(conditions));
     }
 }
示例#2
0
 public List <Role> GetAllRoles()
 {
     try
     {
         using (IDbContextBase context = DbContextFactory.GetDbContext())
         {
             List <Role> listRole = context.FindAll <Role>();
             return(listRole);
         }
     }
     catch
     {
         throw;
     }
 }
示例#3
0
        public List <User_Role> GetUserByRoleId(Guid roleId)
        {
            try
            {
                using (IDbContextBase context = DbContextFactory.GetDbContext())
                {
                    List <User_Role> listRole = context.FindAll <User_Role>(obj => obj.RoleId == roleId);

                    return(listRole);
                }
            }
            catch
            {
                throw;
            }
        }