示例#1
0
        internal static void InitializeProviders()
        {
            object msProvider;

            if (_testProviders.TryGetValue(typeof(IModelServiceProvider), out msProvider))
            {
                IModelServiceProvider modelServiceProvider = (IModelServiceProvider)msProvider;
                modelServiceProvider.AddDataModelExtension(new DefaultModelBuilder());
            }

            SiteConfiguration.InitializeProviders(interfaceType =>
            {
                object provider;
                _testProviders.TryGetValue(interfaceType, out provider);
                return(provider);
            });
        }
示例#2
0
        internal static void InitializeProviders(Type modelServiceProviderType)
        {
            IModelServiceProvider modelServiceProvider =
                (IModelServiceProvider)Activator.CreateInstance(modelServiceProviderType);

            modelServiceProvider.AddDataModelExtension(new DefaultModelBuilder());

            SiteConfiguration.InitializeProviders(interfaceType =>
            {
                object provider;
                if (interfaceType == typeof(IModelServiceProvider))
                {
                    return(modelServiceProvider);
                }
                _testProviders.TryGetValue(interfaceType, out provider);
                return(provider);
            });
        }