Exemplo n.º 1
0
        public async Task <Response <ReturnedFeedDTO> > GetFeedByName(string name)
        {
            var response = new Response <ReturnedFeedDTO>();
            var feed     = await _feedRepo.GetFeedByName(name);

            if (feed is null)
            {
                response.Message = "Invalid feed id provided";
                return(response);
            }

            var data = FeedMapper.ToFeedDTO(feed);

            if (data is null)
            {
                response.Message = "Problem loading feed";
                return(response);
            }

            response.Success = true;
            response.Message = "Getting feed details by name";
            response.Data    = data;
            return(response);
        }