public async Task <PartialViewResult> CreateOrUpdateResourcesModal(long?projectId = null, bool?reloadPartial = null) { PartialViewResult partialViewResult; IProjectAppService projectAppService = this._projectAppService; NullableIdInput <long> nullableIdInput = new NullableIdInput <long>() { Id = projectId }; GetProjectResourceForEditOutput projectResourcesForEdit = await projectAppService.GetProjectResourcesForEdit(nullableIdInput); CreateOrUpdateProjectResourcesModalViewModel createOrUpdateProjectResourcesModalViewModel = new CreateOrUpdateProjectResourcesModalViewModel(projectResourcesForEdit) { ProjectId = projectId.Value }; Project project = await this._projectAppService.GetProject(projectId.Value); ((dynamic)this.ViewBag).ProjectName = project.Label; partialViewResult = (!reloadPartial.HasValue || !bool.Parse(reloadPartial.ToString()) ? this.PartialView("_CreateOrUpdateResourcesModal", createOrUpdateProjectResourcesModalViewModel) : this.PartialView("_ListResourcesView", createOrUpdateProjectResourcesModalViewModel)); return(partialViewResult); }
public CreateOrUpdateProjectResourcesModalViewModel(GetProjectResourceForEditOutput output) { output.MapTo <GetProjectResourceForEditOutput, CreateOrUpdateProjectResourcesModalViewModel>(this); }