public HttpResponseMessage GetTransproInformationModels(BaseViewModel model) { IUnitOfWork uWork = new UnitOfWork(); ITransproInformationRepository transproInformation = new TransproInformationRepository(uWork); ITransproInformationService transproInformationService = new TransproInformationService(transproInformation); try { if (this.ModelState.IsValid) { var TransproInformationList = transproInformationService.GetAllTransproInformationList(model); if (TransproInformationList != null) { return(Request.CreateResponse(HttpStatusCode.OK, TransproInformationList)); } else { string message = "Error in getting Data"; return(Request.CreateErrorResponse(HttpStatusCode.Forbidden, message)); } } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.InnerException.Message)); } }