Ejemplo n.º 1
0
        public async Task <IActionResult> GetProfileCompleteness([FromBody][Required] int?HotelId)
        {
            BaseResult <ProfileCompletenessViewModel> result = new BaseResult <ProfileCompletenessViewModel>();
            var profileCompletenessViewModel = new ProfileCompletenessViewModel();
            var profileCompletenessData      = await iHotel.GetProfileCompleteness(HotelId.Value).ConfigureAwait(false);

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