public async Task <PartialViewResult> FeaturesModal(int id) { Tenant byIdAsync = await this._tenantManager.GetByIdAsync(id); GetTenantFeaturesForEditOutput tenantFeaturesForEdit = await this._tenantAppService.GetTenantFeaturesForEdit(new EntityRequestInput(id)); return(this.PartialView("_FeaturesModal", new TenantFeaturesEditViewModel(byIdAsync, tenantFeaturesForEdit))); }
public async Task <GetTenantFeaturesForEditOutput> GetTenantFeaturesForEdit(EntityRequestInput input) { IReadOnlyList <Feature> all = this.FeatureManager.GetAll(); IReadOnlyList <NameValue> featureValuesAsync = await this.TenantManager.GetFeatureValuesAsync(input.Id); GetTenantFeaturesForEditOutput getTenantFeaturesForEditOutput = new GetTenantFeaturesForEditOutput(); List <FlatFeatureDto> flatFeatureDtos = all.MapTo <List <FlatFeatureDto> >(); getTenantFeaturesForEditOutput.Features = ( from f in flatFeatureDtos orderby f.DisplayName select f).ToList <FlatFeatureDto>(); IReadOnlyList <NameValue> nameValues = featureValuesAsync; getTenantFeaturesForEditOutput.FeatureValues = ( from fv in nameValues select new NameValueDto(fv)).ToList <NameValueDto>(); return(getTenantFeaturesForEditOutput); }
public TenantFeaturesEditViewModel(Tenant tenant, GetTenantFeaturesForEditOutput output) { Tenant = tenant; output.MapTo(this); }
public TenantFeaturesEditViewModel(FuelWerx.MultiTenancy.Tenant tenant, GetTenantFeaturesForEditOutput output) { this.Tenant = tenant; output.MapTo <GetTenantFeaturesForEditOutput, TenantFeaturesEditViewModel>(this); }