protected PFModelConfig GetModelPropertyConfig <TModel, TProperty>(HtmlHelper htmlHelper, Expression <Func <TModel, TProperty> > expression) { var modelType = typeof(TModel); //var modelConfig = PFDataHelper.GetModelConfig(modelType.Name, modelType.FullName); //if (modelConfig == null) //{ // modelConfig = htmlHelper.ViewData["modelConfig"] as PFModelConfigCollection; //} var modelConfig = PFDataHelper.MergeModelConfig( PFDataHelper.GetModelConfig(modelType.Name, modelType.FullName), htmlHelper.ViewData["modelConfig"] as PFModelConfigCollection ); if (modelConfig == null) { return(null); } var propertyName = ExpressionHelper.GetExpressionText(expression); var config = modelConfig[propertyName]; return(config); }