public Result <BeautyTipDto> GetBeautyTips(BeautyTipSearchFilter beautyTipSearchFilter) { using (UnitOfWork unitOfWork = new UnitOfWork()) { return(unitOfWork.BeautyTips.Get(beautyTipSearchFilter, BeautyTipMappers.Instance.MapFromGetBeautyTips)); } }
public Result <BeautyTipDto> Get(BeautyTipSearchFilter beautyTipSearchFilter, Func <SqlDataReader, BeautyTipDto> beautyTipDtoMapper) { List <SqlQueryParameter> sqlQueryParameters = GetPagedDataParameters(beautyTipSearchFilter.PageData); sqlQueryParameters.Add(new SqlQueryParameter { ParameterName = "SubCategoryId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = beautyTipSearchFilter.SubCategoryId }); sqlQueryParameters.Add(new SqlQueryParameter { ParameterName = "CategoryId", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.Integer, ParameterValue = beautyTipSearchFilter.CategoryId }); sqlQueryParameters.Add(new SqlQueryParameter { ParameterName = "StatusCode", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = beautyTipSearchFilter.StatusCode }); sqlQueryParameters.Add(new SqlQueryParameter { ParameterName = "SearchText", ParameterDirection = DbParameterDirection.Input, ParamentType = CodeParameterType.String, ParameterSize = 100, ParameterValue = beautyTipSearchFilter.SearchText }); return(GetPagedEntities("BeautyTipsFetch", beautyTipDtoMapper, sqlQueryParameters.ToArray())); }