Esempio n. 1
0
        public IHttpActionResult GetCareHomesDetails()   // IEnumerable<CareHome>
        {
            var careHomes = _careHomeService.GetCareHomesDetails();

            if (careHomes == null)
            {
                return(NotFound());
            }

            return(Ok(careHomes.ToArray()));
        }
        public IHttpActionResult GetCareHomesDetails()
        {
            var careHomes = _careHomeService.GetCareHomesDetails();

            if (careHomes == null || !careHomes.Any())
            {
                logger.Error($"No carehome details found.");
                return(NotFound());
            }

            return(Ok(careHomes.ToArray()));
        }
        public IHttpActionResult GetCareHomesDetailsByResidentRefId(string referenceId)
        {
            if (string.IsNullOrEmpty(referenceId))
            {
                throw new ArgumentNullException(nameof(referenceId));
            }

            var resident = _residentService.GetResident(GuidConverter.Convert(referenceId));

            if (resident == null)
            {
                return(BadRequest("Cannot find resident. Please contact admin."));
            }

            var careHomeDetail = _careHomeService.GetCareHomesDetails(resident.CareHomeId);

            return(Ok(careHomeDetail));
        }