Esempio n. 1
0
        public async Task <IActionResult> GetAllHotels()
        {
            BaseResult <List <HotelBrandExtendedViewModel> > result;

            var hotelsData = await iHotel.GetAllHotels(LoggedInUserId, LanguageId).ConfigureAwait(false);

            if (hotelsData.IsError && hotelsData.ExceptionMessage != null)
            {
                return(new StatusCodeResult(500));
            }
            else if (hotelsData.Result == null || !hotelsData.Result.Any())
            {
                return(NoContent()); //204
            }
            result = DbMapperMasterdata.MapToHotelBrandExtendeViewModel(hotelsData);
            return(Ok(result));
        }