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