/// <summary>Initializes a new instances of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" /> class.</summary> /// <param name="model">The model of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" />.</param> public StoreItemCollection(EdmModel model) : base(DataSpace.SSpace) { Check.NotNull(model, "model"); DebugCheck.NotNull(model.ProviderInfo); DebugCheck.NotNull(model.ProviderManifest); _providerManifest = model.ProviderManifest; _providerInvariantName = model.ProviderInfo.ProviderInvariantName; _providerFactory = DbConfiguration.DependencyResolver.GetService <DbProviderFactory>(_providerInvariantName); _providerManifestToken = model.ProviderInfo.ProviderManifestToken; _cachedCTypeFunction = new Memoizer <EdmFunction, EdmFunction>(ConvertFunctionSignatureToCType, null); LoadProviderManifest(_providerManifest); _schemaVersion = model.SchemaVersion; model.Validate(); foreach (var globalItem in model.GlobalItems) { globalItem.SetReadOnly(); AddInternal(globalItem); } }
public void Validate_should_throw_on_error() { var model = new EdmModel(DataSpace.CSpace); model.AddItem(new EntityType("E", "N", DataSpace.CSpace)); Assert.Throws<ModelValidationException>(() => model.Validate()); }
public void Validate_should_throw_on_error() { var model = new EdmModel(DataSpace.CSpace); model.AddItem(new EntityType("E", "N", DataSpace.CSpace)); Assert.Throws <ModelValidationException>(() => model.Validate()); }
/// <summary>Initializes a new instance of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.EdmItemCollection" /> class.</summary> /// <param name="model">The entity data model.</param> public EdmItemCollection(EdmModel model) : base(DataSpace.CSpace) { Check.NotNull <EdmModel>(model, nameof(model)); this.Init(); this._edmVersion = model.SchemaVersion; model.Validate(); foreach (GlobalItem globalItem in model.GlobalItems) { globalItem.SetReadOnly(); this.AddInternal(globalItem); } }
/// <summary>Initializes a new instance of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.EdmItemCollection" /> class.</summary> /// <param name="model">The entity data model.</param> public EdmItemCollection(EdmModel model) : base(DataSpace.CSpace) { Check.NotNull(model, "model"); Init(); _edmVersion = model.SchemaVersion; model.Validate(); foreach (var globalItem in model.GlobalItems) { globalItem.SetReadOnly(); AddInternal(globalItem); } }
/// <summary>Initializes a new instances of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" /> class.</summary> /// <param name="model">The model of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" />.</param> public StoreItemCollection(EdmModel model) : base(DataSpace.SSpace) { Check.NotNull <EdmModel>(model, nameof(model)); this._providerManifest = model.ProviderManifest; this._providerInvariantName = model.ProviderInfo.ProviderInvariantName; this._providerFactory = DbConfiguration.DependencyResolver.GetService <DbProviderFactory>((object)this._providerInvariantName); this._providerManifestToken = model.ProviderInfo.ProviderManifestToken; this._cachedCTypeFunction = new Memoizer <EdmFunction, EdmFunction>(new Func <EdmFunction, EdmFunction>(StoreItemCollection.ConvertFunctionSignatureToCType), (IEqualityComparer <EdmFunction>)null); this.LoadProviderManifest(this._providerManifest); this._schemaVersion = model.SchemaVersion; model.Validate(); foreach (GlobalItem globalItem in model.GlobalItems) { globalItem.SetReadOnly(); this.AddInternal(globalItem); } }
/// <summary>Initializes a new instances of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" /> class.</summary> /// <param name="model">The model of the <see cref="T:System.Data.Entity.Core.Metadata.Edm.StoreItemCollection" />.</param> public StoreItemCollection(EdmModel model) : base(DataSpace.SSpace) { Check.NotNull(model, "model"); DebugCheck.NotNull(model.ProviderInfo); DebugCheck.NotNull(model.ProviderManifest); _providerManifest = model.ProviderManifest; _providerInvariantName = model.ProviderInfo.ProviderInvariantName; _providerFactory = DbConfiguration.DependencyResolver.GetService<DbProviderFactory>(_providerInvariantName); _providerManifestToken = model.ProviderInfo.ProviderManifestToken; _cachedCTypeFunction = new Memoizer<EdmFunction, EdmFunction>(ConvertFunctionSignatureToCType, null); LoadProviderManifest(_providerManifest); _schemaVersion = model.SchemaVersion; model.Validate(); foreach (var globalItem in model.GlobalItems) { globalItem.SetReadOnly(); AddInternal(globalItem); } }