public async Task <ActionResult <CommonAPIResponse <PostRelatedIndustryReturnDTO> > > GetPostRelatedIndustryById(int id) { #region Vars PostRelatedIndustryReturnDTO PostRelatedIndustryReturnDTO = null; #endregion #region Declare return type with initial value. JsonResult jsonResult = GetDefaultJsonResult <object>(); #endregion try { if (id != default(int)) { PostRelatedIndustryReturnDTO = await PostRelatedIndustryAppService.GetPostRelatedIndustryById(id); } #region Validate userIdentityDTO for nullability before prepaing the response. if (PostRelatedIndustryReturnDTO != null) { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), PostRelatedIndustryReturnDTO, HttpStatusCode.OK); } else { jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest); } #endregion } catch (Exception exception) { } return(jsonResult); }
/// <summary> /// Get PostRelatedIndustry By Id /// </summary> /// <returns>PostRelatedIndustryReturnDTO<PostRelatedIndustryReturnDTO></returns> public async Task <PostRelatedIndustryReturnDTO> GetPostRelatedIndustryById(int PostRelatedIndustryId) { #region Declare a return type with initial value. PostRelatedIndustryReturnDTO PostRelatedIndustry = null; #endregion try { if (PostRelatedIndustryId > default(int)) { PostRelatedIndustry = await PostRelatedIndustryBusinessMapping.GetPostRelatedIndustryById(PostRelatedIndustryId); } } catch (Exception exception) {} return(PostRelatedIndustry); }
public PostRelatedIndustryReturnDTO MappingPostRelatedIndustryToPostRelatedIndustryReturnDTO(PostRelatedIndustry PostRelatedIndustry) { #region Declare a return type with initial value. PostRelatedIndustryReturnDTO PostRelatedIndustryReturnDTO = null; #endregion try { if (PostRelatedIndustry != null) { PostRelatedIndustryReturnDTO = new PostRelatedIndustryReturnDTO { IndustryId = PostRelatedIndustry.IndustryId, PostId = PostRelatedIndustry.PostId, PostRelatedIndustryId = PostRelatedIndustry.PostRelatedIndustryId }; } } catch (Exception exception) { } return(PostRelatedIndustryReturnDTO); }
/// <summary> /// Get user Action Activity Log By Id /// </summary> /// <returns>List<PostRelatedIndustryReturnDTO></returns> public async Task <PostRelatedIndustryReturnDTO> GetPostRelatedIndustryById(int PostRelatedIndustryId) { #region Declare a return type with initial value. PostRelatedIndustryReturnDTO PostRelatedIndustry = new PostRelatedIndustryReturnDTO(); #endregion try { PostRelatedIndustry postRelatedIndustry = await UnitOfWork.PostRelatedIndustryRepository.GetById(PostRelatedIndustryId); if (postRelatedIndustry != null) { if (postRelatedIndustry.IsDeleted != (byte)DeleteStatusEnum.Deleted) { PostRelatedIndustry = PostRelatedIndustryMapping.MappingPostRelatedIndustryToPostRelatedIndustryReturnDTO(postRelatedIndustry); } } } catch (Exception exception) { } return(PostRelatedIndustry); }