public async Task <IActionResult> GetSponsors()
        {
            var sponsors = await _sponsorRepo.AllSponsors();

            var sponsorsResource = _mapper.Map <List <Sponsor>, List <SponsorResource> >(sponsors);

            return(Ok(sponsorsResource));
        }
Exemple #2
0
        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));
        }