// GET: Users/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var user = await _userManager.FindByIdAsync(id.ToString()); if (user == null) { return(NotFound()); } var vm = new UserCreateViewModel() { AppUser = AppUserMapper.MapFromDAL(DAL.App.EF.Mappers.AppUserMapper.MapFromDomain(user)), AppUserRoles = await _userManager.GetRolesAsync(user), ShopsSelectList = new SelectList(await _bll.Shops.AllAsync(), nameof(Shop.Id), nameof(Shop.ShopName), user.ShopId), RolesSelectList = new SelectList(await _roleManager.Roles.ToListAsync(), nameof(AppRole.Name), nameof(AppRole.Name)) }; PreSelect(vm.AppUserRoles, vm.RolesSelectList); return(View(vm)); }
public async Task <List <AppUser> > AllAsync(string order, string searchFor) { var res = (await Uow.AppUsers.AllAsync(order, searchFor)).Select(e => AppUserMapper.MapFromDAL(e)).ToList(); return(res); }
public async Task <DTO.Identity.AppUser> GetUserInfo(int userId) { return(AppUserMapper.MapFromDAL(await Uow.AppUsers.GetUserInfo(userId))); }
public async Task <List <AppUser> > GetUserById(int userId) { return((await Uow.AppUsers.GetUserById(userId)).Select(e => AppUserMapper.MapFromDAL(e)).ToList()); }
public override async Task <AppUser> FindAsync(params object[] id) { return(AppUserMapper.MapFromDAL(await Uow.AppUsers.FindAsync(id))); }
/*public override async Task<IEnumerable<AppUser>> AllAsync() * { * return await UOW.AppUsers.AllAsync(); * } * * public override async Task<AppUser> FindAsync(params object[] id) * { * return await UOW.AppUsers.FindAsync(id); * } * * public async Task<AppUserDTO> GetUserInfo(int userId) * { * return await UOW.AppUsers.GetUserInfo(userId); * } * * public async Task<IEnumerable<AppUser>> GetUserById(int userId) * { * return await UOW.AppUsers.GetUserById(userId); * } * * public async Task<IEnumerable<AppUser>> AllAsyncByShop(int? shopId) * { * return await UOW.AppUsers.AllAsyncByShop(shopId); * * } * * public async Task<int> CountUsersInShop(int? shopId) * { * return await UOW.AppUsers.CountUsersInShop(shopId); * } * * public async Task<int> CountAllUsers() * { * return await UOW.AppUsers.CountAllUsers(); * }*/ public override async Task <List <AppUser> > AllAsync() { return((await Uow.AppUsers.AllAsync()).Select(e => AppUserMapper.MapFromDAL(e)).ToList()); }