/// <summary> /// Prepare discount search model /// </summary> /// <param name="searchModel">Discount search model</param> /// <returns> /// A task that represents the asynchronous operation /// The task result contains the discount search model /// </returns> public virtual async Task <DiscountSearchModel> PrepareDiscountSearchModelAsync(DiscountSearchModel searchModel) { if (searchModel == null) { throw new ArgumentNullException(nameof(searchModel)); } //prepare available discount types await _baseAdminModelFactory.PrepareDiscountTypesAsync(searchModel.AvailableDiscountTypes); //prepare page parameters searchModel.SetGridPageSize(); return(searchModel); }