public IHttpActionResult GetAll()
        {
            try
            {
                var response = _institutionRepo.FindAll();

                HttpAssert.Success(response);
                HttpAssert.NotNull(response, "Unable to find institutions");

                return(Ok(response.Result.ToList()));
            }
            catch (Exception ex)
            {
                if (_logger != null)
                {
                    _logger.Write(ex);
                }
                return(InternalServerError());
            }
        }
Beispiel #2
0
        public ActionResult Index()
        {
            var model = _institutionRepository.FindAll().ProjectTo <InstitutionModel>();

            return(new EnhancedJsonResult(model, JsonRequestBehavior.AllowGet));
        }