public IEnumerable <ApplicationRole> GetAll(int page, int pageSize, out int totalRow, string filter = null) { var query = _appRoleRepository.GetAll(); if (!string.IsNullOrEmpty(filter)) { query = query.Where(x => x.Description.Contains(filter)); } totalRow = query.Count(); return(query.OrderBy(x => x.Description).Skip(page * pageSize).Take(pageSize)); }
public IEnumerable <ApplicationRole> GetAll(string keyword) { if (!string.IsNullOrEmpty(keyword)) { return(_appRoleRepository.GetMulti(x => x.Name.Contains(keyword))); } else { return(_appRoleRepository.GetAll()); } }
public ActionResult Edit(string id) { if (!string.IsNullOrEmpty(id)) { var user = _aspNetUsersRepository.GetMany(x => !x.IsDeleted && x.Id == id) .FirstOrDefault(); var role = _identityUserRoleRepository.GetMany(x => x.UserId == id).FirstOrDefault(); if (user != null) { ViewBag.Roles = _applicationRoleRepository.GetAll().Select(x => new { Id = x.Id, Name = x.Name }).ToList(); var toReturn = Mapper.Map <ApplicationUser, AccountModel>(user); toReturn.RoleId = role.RoleId.ToString(); return(View(toReturn)); } else { return(null); } } return(null); }
public IEnumerable <IdentityRole> GetAll() { return(_appRoleRepository.GetAll()); }
public IEnumerable <ApplicationRole> GetAll() { return(_appRoleRepository.GetAll()); }
public IEnumerable <CustomRole> GetAll() { return(_appRoleRepository.GetAll()); }
public async Task <IEnumerable <ApplicationRole> > GetAll() { return(await _appRoleRepository.GetAll()); }