Exemplo n.º 1
0
        public async Task <IActionResult> GeFAQs(int compId, int platformId = (int)Platforms.Hulool)
        {
            ResponseHttp <IList <FAQDto> > response = new ResponseHttp <IList <FAQDto> >();

            try
            {
                var faqList = await fAQRepository.GetByCompetitionIdAsync(compId, platformId);

                if (faqList != null && faqList.Count > 0)
                {
                    response.Data       = mapper.Map <IList <FAQDto> >(faqList);
                    response.StatusCode = System.Net.HttpStatusCode.OK;
                    return(Ok(response));
                }
                else
                {
                    return(NotFound());
                }
            }
            catch (Exception ex)
            {
                commonFunctions.LogError(ex);
                return(StatusCode(500));
            }
        }