예제 #1
0
        public async Task <IActionResult> GetTerms(int compId, int platformId = (int)Platforms.Hulool)
        {
            ResponseHttp <IList <TermDto> > response = new ResponseHttp <IList <TermDto> >();

            try
            {
                var terms = await termRepository.GetParentTermsAsync(compId, platformId);

                if (terms == null)
                {
                    return(NotFound());
                }
                else
                {
                    response.Data       = mapper.Map <IList <TermDto> >(terms);
                    response.StatusCode = System.Net.HttpStatusCode.OK;
                    return(Ok(response));
                }
            }
            catch (Exception ex)
            {
                commonFunctions.LogError(ex);
                return(StatusCode(500));
            }
        }