public async Task <PartialViewResult> CreateOrUpdateResourcesModal(long?productId = null, bool?reloadPartial = null) { PartialViewResult partialViewResult; IProductAppService productAppService = this._productAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = productId }; GetProductResourceForEditOutput productResourcesForEdit = await productAppService.GetProductResourcesForEdit(nullableIdInput); CreateOrUpdateProductResourcesModalViewModel createOrUpdateProductResourcesModalViewModel = new CreateOrUpdateProductResourcesModalViewModel(productResourcesForEdit) { ProductId = productId.Value }; Product product = await this._productAppService.GetProduct(productId.Value); ((dynamic)this.ViewBag).ProductName = product.Name; partialViewResult = (!reloadPartial.HasValue || !bool.Parse(reloadPartial.ToString()) ? this.PartialView("_CreateOrUpdateResourcesModal", createOrUpdateProductResourcesModalViewModel) : this.PartialView("_ListResourcesView", createOrUpdateProductResourcesModalViewModel)); return(partialViewResult); }
public CreateOrUpdateProductResourcesModalViewModel(GetProductResourceForEditOutput output) { output.MapTo <GetProductResourceForEditOutput, CreateOrUpdateProductResourcesModalViewModel>(this); }