Beispiel #1
0
        public HttpResponseMessage Get()
        {
            var glossaryListResponse = new GlossaryListResponse();

            try
            {
                glossaryListResponse.Glossaries = _glossaryRepository.Get();
                glossaryListResponse.Code       = InternalApiStatusCode.Success;

                return(Request.CreateResponse(HttpStatusCode.OK, glossaryListResponse));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Beispiel #2
0
        public async Task <ResponseModel <GlossaryModel> > Get(string term)
        {
            var response = await _repository.Get(term);

            return(new ResponseModel <GlossaryModel>()
            {
                Count = 1,
                PageNumber = 1,
                PageSize = 1,
                Records = new List <GlossaryModel>()
                {
                    response
                }
            });
        }