public async Task <IActionResult> GetSponsors() { var sponsors = await _sponsorRepo.AllSponsors(); var sponsorsResource = _mapper.Map <List <Sponsor>, List <SponsorResource> >(sponsors); return(Ok(sponsorsResource)); }
public async Task <IActionResult> GetAllSponsorUsers() { var sponsorUsers = await _userManager.GetUsersInRoleAsync(RolesConst.Sponsor); var sponsors = await _sponsorRepo.AllSponsors(); var result = _mapper.Map <IList <ApplicationUser>, List <ReadUserResource> >(sponsorUsers); var model = new SponsorsViewModel { SponsorUsers = result }; return(Ok(result)); }