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)); } }
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 } }); }