Example #1
0
        private IPropertyProvider GetRequiredPropertyProvider(Type type)
        {
            IPropertyProvider propertyProvider = _dataContext.MetadataContext.PropertyProviders[type];

            if (propertyProvider != null)
            {
                return(propertyProvider);
            }

            if (_dataContext.MetadataContext.PropertyProviders.DefaultValue == null)
            {
                throw ExceptionBuilder.NoPropertyProviderRegisteredAndDefaultProviderIsMissing(type);
            }

            return(_dataContext.MetadataContext.PropertyProviders.DefaultValue);
        }