protected AbstractViewModelMetadataDictionary(Expression <Func <IEntityService <DataDictionary> > > lazyLoadedService, IViewModelDisplayNameCollection displayNameCollection, ViewModelMetadataWrapper viewModelMetaDataWrapper) { displayNameCollection.Guard(string.Format("{0}.", typeof(IViewModelDisplayNameCollection).Name)); viewModelMetaDataWrapper.Guard(string.Format("{0}.", typeof(ViewModelMetadataWrapper).Name)); _lazyLoadedService = lazyLoadedService; ViewModelMetaDataWrapper = viewModelMetaDataWrapper; DisplayNameCollection = displayNameCollection; }
public ViewModelMetadataDictionaryCached(Expression <Func <IEntityService <DataDictionary> > > lazyLoadedService, IViewModelDisplayNameCollection displayNameCollection, ViewModelMetadataWrapper viewModelMetaDataWrapper) : base(lazyLoadedService, displayNameCollection, viewModelMetaDataWrapper) { }
private bool IsValidViewModel(ViewModelMetadataWrapper wrapper) { return(wrapper.Container != null //&& wrapper.Container.Name.Contains("ViewModel") && !string.IsNullOrEmpty(wrapper.PropertyName)); }
private bool IsAttributeClearForAdd(ViewModelMetadataWrapper wrapper) { return(!wrapper.Attributes.Any(attribute => attribute is DisplayAttribute)); }
private List <AbstractViewModelMetadataDictionary> CreateMetaDataAttributeOverrider(ViewModelMetadataWrapper wrapper) { var viewModelDictionary = new List <AbstractViewModelMetadataDictionary> { new ViewModelMetadataDictionaryLoader(_lazyLoadedService, DisplayNameCollection, wrapper), new ViewModelMetadataDictionaryCached(_lazyLoadedService, DisplayNameCollection, wrapper) }; return(viewModelDictionary); }