public GetCategoryMasterResponseDto GetCategoryMaster() { GetCategoryMasterResponseDto response; try { response = rCategoryMasterProvider.GetCategoryMaster(); response.ServiceResponseStatus = 1; } catch (SSException applicationException) { response = new GetCategoryMasterResponseDto { ServiceResponseStatus = 0, ErrorMessage = applicationException.Message, ErrorCode = applicationException.ExceptionCode }; } catch (Exception exception) { response = new GetCategoryMasterResponseDto { ServiceResponseStatus = 0, ErrorCode = ExceptionAttributes.ExceptionCodes.InternalServerError, ErrorMessage = exception.Message }; } return(response); }
public GetCategoryMasterResponseDto GetCategoryMaster() { var response = new GetCategoryMasterResponseDto(); var model = categoryMastersRepository.GetCategoryMaster(); if (model != null) { response = CategoryMasterMapper((List <CategoryMasterModel>)model.CategoryMasterList, response); response.RecordCount = model.RecordCount; } return(response); }
private static GetCategoryMasterResponseDto CategoryMasterMapper(List <CategoryMasterModel> list, GetCategoryMasterResponseDto getCategoryMasterResponseDto) { Mapper.CreateMap <CategoryMasterModel, CategoryMaster>(); getCategoryMasterResponseDto.CategoryMasterList = Mapper.Map <List <CategoryMasterModel>, List <CategoryMaster> >(list); return(getCategoryMasterResponseDto); }