public async Task <ActionResult <IEnumerable <UserDTO> > > GetPartners()
        {
            var partners = await _partnersRepository.GetPartnersAsync();

            var partnersToReturn = _mapper.Map <IEnumerable <UserDTO> >(partners);

            return(Ok(partnersToReturn));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetPartnerAsync(int partnerId)
        {
            try
            {
                RefPartners partner = await _partnersRepository.GetPartnersAsync(partnerId);

                if (partner != null)
                {
                    return(new OkObjectResult(partner));
                }
                else
                {
                    return(new NotFoundResult());
                }
            }
            catch
            {
                return(new ConflictResult());
            }
        }