示例#1
0
文件: Tenant.cs 项目: psmith6/marten
        private void ensureStorageExists(IList <Type> types, Type featureType)
        {
            if (_checks.ContainsKey(featureType))
            {
                return;
            }


            // TODO -- ensure the system type here too?
            var feature = _features.FindFeature(featureType);

            feature.AssertValidNames(_options);

            if (feature == null)
            {
                throw new ArgumentOutOfRangeException(nameof(featureType),
                                                      $"Unknown feature type {featureType.FullName}");
            }

            if (_checks.ContainsKey(feature.StorageType))
            {
                _checks[featureType] = true;
                return;
            }

            // Preventing cyclic dependency problems
            if (types.Contains(featureType))
            {
                return;
            }

            types.Fill(featureType);

            foreach (var dependentType in feature.DependentTypes())
            {
                ensureStorageExists(types, dependentType);
            }

            // TODO -- might need to do a lock here.
            generateOrUpdateFeature(featureType, feature);
        }
示例#2
0
        private void ensureStorageExists(IList <Type> types, Type featureType)
        {
            if (_checks.ContainsKey(featureType))
            {
                return;
            }

            var feature = _features.FindFeature(featureType);

            if (feature == null)
            {
                throw new ArgumentOutOfRangeException(nameof(featureType),
                                                      $"Unknown feature type {featureType.FullName}");
            }

            if (_checks.ContainsKey(feature.StorageType))
            {
                _checks[featureType] = true;
                return;
            }

            // Preventing cyclic dependency problems
            if (types.Contains(featureType))
            {
                return;
            }

            types.Fill(featureType);

            foreach (var dependentType in feature.DependentTypes())
            {
                ensureStorageExists(types, dependentType);
            }

            generateOrUpdateFeature(featureType, feature);
        }
示例#3
0
 public override IFeatureSchema FindFeature(Type featureType)
 {
     return(_features.FindFeature(featureType));
 }