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)); } }
public List <Role> GetAllRoles() { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { List <Role> listRole = context.FindAll <Role>(); return(listRole); } } catch { throw; } }
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; } }