• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Common.DbProviderManifest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.Entity.Core.Common.DbProviderManifest的典型用法代码示例。如果您正苦于以下问题:C# DbProviderManifest类的具体用法?C# DbProviderManifest怎么用?C# DbProviderManifest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DbProviderManifest类属于System.Data.Entity.Core.Common命名空间,在下文中一共展示了DbProviderManifest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Configure

        public virtual void Configure(
            EntityTypeModificationFunctionMapping modificationStoredProcedureMapping,
            DbProviderManifest providerManifest)
        {
            DebugCheck.NotNull(modificationStoredProcedureMapping);
            DebugCheck.NotNull(providerManifest);

            if (_insertModificationStoredProcedureConfiguration != null)
            {
                _insertModificationStoredProcedureConfiguration
                    .Configure(modificationStoredProcedureMapping.InsertFunctionMapping, providerManifest);
            }

            if (_updateModificationStoredProcedureConfiguration != null)
            {
                _updateModificationStoredProcedureConfiguration
                    .Configure(modificationStoredProcedureMapping.UpdateFunctionMapping, providerManifest);
            }

            if (_deleteModificationStoredProcedureConfiguration != null)
            {
                _deleteModificationStoredProcedureConfiguration
                    .Configure(modificationStoredProcedureMapping.DeleteFunctionMapping, providerManifest);
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:25,代码来源:ModificationStoredProceduresConfiguration.cs


示例2: DatabaseMappingGenerator

        public DatabaseMappingGenerator(DbProviderInfo providerInfo, DbProviderManifest providerManifest)
        {
            DebugCheck.NotNull(providerInfo);
            DebugCheck.NotNull(providerManifest);

            _providerInfo = providerInfo;
            _providerManifest = providerManifest;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:8,代码来源:DatabaseMappingGenerator.cs


示例3: PrimitiveType

 /// <summary>
 ///     The constructor for PrimitiveType, it takes in a CLR type containing the identity information
 /// </summary>
 /// <param name="clrType"> The CLR type object for this primitive type </param>
 /// <param name="baseType"> The base type for this primitive type </param>
 /// <param name="providerManifest"> The ProviderManifest of the provider of this type </param>
 internal PrimitiveType(
     Type clrType,
     PrimitiveType baseType,
     DbProviderManifest providerManifest)
     : this(EntityUtil.GenericCheckArgumentNull(clrType, "clrType").Name, clrType.Namespace,
         DataSpace.OSpace, baseType, providerManifest)
 {
     Debug.Assert(clrType == ClrEquivalentType, "not equivalent to ClrEquivalentType");
 }
开发者ID:junxy,项目名称:entityframework,代码行数:15,代码来源:PrimitiveType.cs


示例4: PrimitiveType

 // <summary>
 // The constructor for PrimitiveType, it takes in a CLR type containing the identity information
 // </summary>
 // <param name="clrType"> The CLR type object for this primitive type </param>
 // <param name="baseType"> The base type for this primitive type </param>
 // <param name="providerManifest"> The ProviderManifest of the provider of this type </param>
 internal PrimitiveType(
     Type clrType,
     PrimitiveType baseType,
     DbProviderManifest providerManifest)
     : this(Check.NotNull(clrType, "clrType").Name, clrType.NestingNamespace(),
         DataSpace.OSpace, baseType, providerManifest)
 {
     Debug.Assert(clrType == ClrEquivalentType, "not equivalent to ClrEquivalentType");
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:15,代码来源:PrimitiveType.cs


示例5: DbModel

        internal DbModel(DbProviderInfo providerInfo, DbProviderManifest providerManifest)
        {
            DebugCheck.NotNull(providerInfo);
            DebugCheck.NotNull(providerManifest);

            _databaseMapping = new DbDatabaseMapping().Initialize(
                EdmModel.CreateConceptualModel(),
                EdmModel.CreateStoreModel(providerInfo, providerManifest));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:9,代码来源:DbModel.cs


示例6: DmlFunctionSqlGenerator

        public DmlFunctionSqlGenerator(DbProviderManifest providerManifest)
        {
            DebugCheck.NotNull(providerManifest);

            var sqlManifest = providerManifest as SqlProviderManifest;

            if (sqlManifest == null)
            {
                throw new ArgumentException(Strings.Mapping_Provider_WrongManifestType(typeof(SqlProviderManifest)));
            }

            _sqlGenerator = new SqlGenerator(sqlManifest.SqlVersion);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:13,代码来源:DmlFunctionSqlGenerator.cs


示例7: ConfigureColumn

        protected override void ConfigureColumn(EdmProperty column, EntityType table, DbProviderManifest providerManifest)
        {
            if (IsRowVersion != null
                && IsRowVersion.Value)
            {
                ColumnType = ColumnType ?? "rowversion";
            }

            base.ConfigureColumn(column, table, providerManifest);

            if (IsRowVersion != null
                && IsRowVersion.Value)
            {
                column.MaxLength = null;
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:16,代码来源:BinaryPropertyConfiguration.cs


示例8: Configure

        internal override void Configure(
            IEnumerable<Tuple<DbEdmPropertyMapping, DbTableMetadata>> propertyMappings,
            DbProviderManifest providerManifest,
            bool allowOverride = false)
        {
            base.Configure(propertyMappings, providerManifest, allowOverride);

            propertyMappings
                .Each(
                    pm =>
                        {
                            if (IsRowVersion != null)
                            {
                                pm.Item1.Column.Facets.MaxLength = null;
                            }
                        });
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:17,代码来源:BinaryPropertyConfiguration.cs


示例9: Configure

        internal override void Configure(
            IEnumerable<Tuple<ColumnMappingBuilder, EntityType>> propertyMappings,
            DbProviderManifest providerManifest,
            bool allowOverride = false)
        {
            base.Configure(propertyMappings, providerManifest, allowOverride);

            propertyMappings
                .Each(
                    pm =>
                        {
                            if (IsRowVersion != null)
                            {
                                pm.Item1.ColumnProperty.MaxLength = null;
                            }
                        });
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:17,代码来源:BinaryPropertyConfiguration.cs


示例10: GetProviderManifest

 internal DbProviderManifest GetProviderManifest(Action<string, ErrorCode, EdmSchemaErrorSeverity> addError)
 {
     if (_providerManifest == null)
     {
         _providerManifest = _providerManifestNeeded(addError);
     }
     return _providerManifest;
 }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:8,代码来源:SchemaManager.cs


示例11: ParseAndValidate

 public static IList<EdmSchemaError> ParseAndValidate(
     IEnumerable<XmlReader> xmlReaders,
     IEnumerable<string> sourceFilePaths, SchemaDataModelOption dataModel,
     DbProviderManifest providerManifest,
     out IList<Schema> schemaCollection)
 {
     return ParseAndValidate(
         xmlReaders,
         sourceFilePaths,
         dataModel,
         NoOpAttributeValueNotification,
         NoOpAttributeValueNotification,
         delegate { return providerManifest == null ? MetadataItem.EdmProviderManifest : providerManifest; },
         out schemaCollection);
 }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:15,代码来源:SchemaManager.cs


示例12: GetStoreType

        public static string GetStoreType(this EdmMember edmMember, DbProviderManifest providerManifest)
        {
            var storeType = edmMember.GetStoreTypeUsage(providerManifest);

            if (storeType != null
                && storeType.EdmType != null
                && storeType.EdmType.Name != null)
            {
                return storeType.EdmType.Name.TrimStart('.');
            }
            return String.Empty;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:12,代码来源:MetadataWorkspaceExtensions.cs


示例13: GetStoreTypeUsage

        private static TypeUsage GetStoreTypeUsage(this EdmMember edmMember, DbProviderManifest providerManifest)
        {
            TypeUsage storeType = null;

            var conceptualType = edmMember.TypeUsage;
            Debug.Assert(conceptualType != null, "EdmMember's TypeUsage is null");
            if (conceptualType != null)
            {
                // if the EDM type is an enum, then we need to pass in the underlying type to the GetStoreType API.
                var enumType = conceptualType.EdmType as EnumType;
                storeType = (enumType != null)
                                ? providerManifest.GetStoreType(TypeUsage.CreateDefaultTypeUsage(enumType.UnderlyingType))
                                : providerManifest.GetStoreType(conceptualType);
            }
            return storeType;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:16,代码来源:MetadataWorkspaceExtensions.cs


示例14: ModificationFunctionMappingGenerator

 public ModificationFunctionMappingGenerator(DbProviderManifest providerManifest)
     : base(providerManifest)
 {
 }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:4,代码来源:ModificationFunctionMappingGenerator.cs


示例15: InferSsdlFacetsForCsdlProperty

        public static IEnumerable<Facet> InferSsdlFacetsForCsdlProperty(this EdmProperty csdlProperty, DbProviderManifest providerManifest)
        {
            var storeType = csdlProperty.GetStoreTypeUsage(providerManifest);
            Dictionary<string, Facet> storeFacetLookup = storeType.Facets.ToDictionary(f => f.Name, f => f);

            // Note that there are some facets that exist in the C-side but not in the store side (Collation/ConcurrencyMode)
            // Also the IsStrict facet can exist on the C-side but should not be used on the S-side despite the fact that e.g. SqlServer.geometry defines that facet
            return
                csdlProperty.TypeUsage.Facets.Where(
                    f =>
                    (storeFacetLookup.ContainsKey(f.Name) && storeFacetLookup[f.Name].Description.IsConstant == false
                     && !"IsStrict".Equals(f.Name, StringComparison.Ordinal)));
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:13,代码来源:MetadataWorkspaceExtensions.cs


示例16: ConvertToNavigationProperty

        /// <summary>
        /// Converts a navigation property from SOM to metadata
        /// </summary>
        /// <param name="declaringEntityType">entity type on which this navigation property was declared</param>
        /// <param name="somNavigationProperty">The SOM element to process</param>
        /// <param name="providerManifest">The provider manifest to be used for conversion</param>
        /// <param name="convertedItemCache">The item collection for currently existing metadata objects</param>
        /// <param name="newGlobalItems">The new GlobalItem objects that are created as a result of this conversion</param>
        /// <returns>The property object resulting from the convert</returns>
        private static NavigationProperty ConvertToNavigationProperty(
            EntityType declaringEntityType,
            Som.NavigationProperty somNavigationProperty,
            DbProviderManifest providerManifest,
            ConversionCache convertedItemCache,
            Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems)
        {
            // Navigation properties cannot be primitive types, so we can ignore the possibility of having primitive type
            // facets
            var toEndEntityType = (EntityType)LoadSchemaElement(
                somNavigationProperty.Type,
                providerManifest,
                convertedItemCache,
                newGlobalItems);

            EdmType edmType = toEndEntityType;

            // Also load the relationship Type that this navigation property represents
            var relationshipType = (AssociationType)LoadSchemaElement(
                (Som.Relationship)somNavigationProperty.Relationship,
                providerManifest, convertedItemCache, newGlobalItems);

            Som.IRelationshipEnd somRelationshipEnd = null;
            somNavigationProperty.Relationship.TryGetEnd(somNavigationProperty.ToEnd.Name, out somRelationshipEnd);
            if (somRelationshipEnd.Multiplicity
                == RelationshipMultiplicity.Many)
            {
                edmType = toEndEntityType.GetCollectionType();
            }
            else
            {
                Debug.Assert(somRelationshipEnd.Multiplicity != RelationshipMultiplicity.Many);
                edmType = toEndEntityType;
            }

            TypeUsage typeUsage;
            if (somRelationshipEnd.Multiplicity
                == RelationshipMultiplicity.One)
            {
                typeUsage = TypeUsage.Create(
                    edmType,
                    new FacetValues
                        {
                            Nullable = false
                        });
            }
            else
            {
                typeUsage = TypeUsage.Create(edmType);
            }

            // We need to make sure that both the ends of the relationtype are initialized. If there are not, then we should
            // initialize them here
            InitializeAssociationEndMember(relationshipType, somNavigationProperty.ToEnd, toEndEntityType);
            InitializeAssociationEndMember(relationshipType, somNavigationProperty.FromEnd, declaringEntityType);

            // The type of the navigation property must be a ref or collection depending on which end they belong to
            var navigationProperty = new NavigationProperty(somNavigationProperty.Name, typeUsage);
            navigationProperty.RelationshipType = relationshipType;
            navigationProperty.ToEndMember = (RelationshipEndMember)relationshipType.Members[somNavigationProperty.ToEnd.Name];
            navigationProperty.FromEndMember = (RelationshipEndMember)relationshipType.Members[somNavigationProperty.FromEnd.Name];

            // Extract the optional Documentation
            if (somNavigationProperty.Documentation != null)
            {
                navigationProperty.Documentation = ConvertToDocumentation(somNavigationProperty.Documentation);
            }
            AddOtherContent(somNavigationProperty, navigationProperty);

            return navigationProperty;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:80,代码来源:Converter.cs


示例17: LoadEntityTypePhase2

        private static void LoadEntityTypePhase2(
            Som.SchemaEntityType element,
            DbProviderManifest providerManifest,
            ConversionCache convertedItemCache,
            Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems)
        {
            var entityType = (EntityType)newGlobalItems[element];

            // Since Navigation properties are internal and not part of member collection, we
            // need to initialize the base class first before we start adding the navigation property
            // this will ensure that all the base navigation properties are initialized
            foreach (var somNavigationProperty in element.NavigationProperties)
            {
                entityType.AddMember(
                    ConvertToNavigationProperty(
                        entityType,
                        somNavigationProperty,
                        providerManifest,
                        convertedItemCache,
                        newGlobalItems));
            }
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:22,代码来源:Converter.cs


示例18: LoadSchemaElement

        internal static MetadataItem LoadSchemaElement(
            Som.SchemaType element,
            DbProviderManifest providerManifest,
            ConversionCache convertedItemCache,
            Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems)
        {
            Debug.Assert(providerManifest != null, "This will make the dataspace to be default SSpace");
            // Try to fetch from the collection first
            GlobalItem item;

            Debug.Assert(
                !convertedItemCache.ItemCollection.TryGetValue(element.FQName, false, out item),
                "Som should have checked for duplicate items");

            // Try to fetch in our collection of new GlobalItems
            if (newGlobalItems.TryGetValue(element, out item))
            {
                return item;
            }

            var entityContainer = element as Som.EntityContainer;
            // Perform different conversion depending on the type of the SOM object
            if (entityContainer != null)
            {
                item = ConvertToEntityContainer(
                    entityContainer,
                    providerManifest,
                    convertedItemCache,
                    newGlobalItems);
            }
            else if (element is Som.SchemaEntityType)
            {
                item = ConvertToEntityType(
                    (Som.SchemaEntityType)element,
                    providerManifest,
                    convertedItemCache,
                    newGlobalItems);
            }
            else if (element is Som.Relationship)
            {
                item = ConvertToAssociationType(
                    (Som.Relationship)element,
                    providerManifest,
                    convertedItemCache,
                    newGlobalItems);
            }
            else if (element is Som.SchemaComplexType)
            {
                item = ConvertToComplexType(
                    (Som.SchemaComplexType)element,
                    providerManifest,
                    convertedItemCache,
                    newGlobalItems);
            }
            else if (element is Som.Function)
            {
                item = ConvertToFunction(
                    (Som.Function)element, providerManifest,
                    convertedItemCache, null, newGlobalItems);
            }
            else if (element is Som.SchemaEnumType)
            {
                item = ConvertToEnumType((Som.SchemaEnumType)element, newGlobalItems);
            }
            else
            {
                // the only type we don't handle is the ProviderManifest TypeElement
                // if it is anything else, it is probably a mistake
                Debug.Assert(
                    element is Som.TypeElement &&
                    element.Schema.DataModel == Som.SchemaDataModelOption.ProviderManifestModel,
                    "Unknown Type in somschema");
                return null;
            }

            return item;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:77,代码来源:Converter.cs


示例19: ConvertToProperty

        /// <summary>
        /// Converts a property from SOM to metadata
        /// </summary>
        /// <param name="somProperty">The SOM element to process</param>
        /// <param name="providerManifest">The provider manifest to be used for conversion</param>
        /// <param name="convertedItemCache">The item collection for currently existing metadata objects</param>
        /// <param name="newGlobalItems">The new GlobalItem objects that are created as a result of this conversion</param>
        /// <returns>The property object resulting from the convert</returns>
        private static EdmProperty ConvertToProperty(
            Som.StructuredProperty somProperty,
            DbProviderManifest providerManifest,
            ConversionCache convertedItemCache,
            Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems)
        {
            EdmProperty property;

            // Get the appropriate type object for this type, for primitive and enum types, get the facet values for the type
            // property as a type usage object as well                  
            TypeUsage typeUsage = null;

            var scalarType = somProperty.Type as Som.ScalarType;

            if (scalarType != null
                && somProperty.Schema.DataModel != Som.SchemaDataModelOption.EntityDataModel)
            {
                // parsing ssdl
                typeUsage = somProperty.TypeUsage;
                UpdateSentinelValuesInFacets(ref typeUsage);
            }
            else
            {
                EdmType propertyType;

                if (scalarType != null)
                {
                    Debug.Assert(somProperty.TypeUsage.EdmType.BuiltInTypeKind == BuiltInTypeKind.PrimitiveType);
                    // try to get the instance of the primitive type from the item collection so that it back pointer is set.
                    propertyType = convertedItemCache.ItemCollection.GetItem<PrimitiveType>(somProperty.TypeUsage.EdmType.FullName);
                }
                else
                {
                    propertyType = (EdmType)LoadSchemaElement(somProperty.Type, providerManifest, convertedItemCache, newGlobalItems);
                }

                if (somProperty.CollectionKind
                    != CollectionKind.None)
                {
                    typeUsage = TypeUsage.Create(new CollectionType(propertyType));
                }
                else
                {
                    var enumType = scalarType == null ? somProperty.Type as Som.SchemaEnumType : null;
                    typeUsage = TypeUsage.Create(propertyType);
                    if (enumType != null)
                    {
                        somProperty.EnsureEnumTypeFacets(convertedItemCache, newGlobalItems);
                    }

                    if (somProperty.TypeUsage != null)
                    {
                        ApplyTypePropertyFacets(somProperty.TypeUsage, ref typeUsage);
                    }
                }
            }

            PopulateGeneralFacets(somProperty, ref typeUsage);
            property = new EdmProperty(somProperty.Name, typeUsage);

            // Extract the optional Documentation
            if (somProperty.Documentation != null)
            {
                property.Documentation = ConvertToDocumentation(somProperty.Documentation);
            }
            AddOtherContent(somProperty, property);

            return property;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:77,代码来源:Converter.cs


示例20: ConvertToEntityContainer

        /// <summary>
        /// Converts an entity container from SOM to metadata
        /// </summary>
        /// <param name="element">The SOM element to process</param>
        /// <param name="providerManifest">The provider manifest to be used for conversion</param>
        /// <param name="convertedItemCache">The item collection for currently existing metadata objects</param>
        /// <param name="newGlobalItems">The new GlobalItem objects that are created as a result of this conversion</param>
        /// <returns>The entity container object resulting from the convert</returns>
        private static EntityContainer ConvertToEntityContainer(
            Som.EntityContainer element,
            DbProviderManifest providerManifest,
            ConversionCache convertedItemCache,
            Dictionary<Som.SchemaElement, GlobalItem> newGlobalItems)
        {
            // Creating a new entity container object and populate with converted entity set objects
            var entityContainer = new EntityContainer(element.Name, GetDataSpace(providerManifest));
            newGlobalItems.Add(element, entityContainer);

            foreach (var entitySet in element.EntitySets)
            {
                entityContainer.AddEntitySetBase(
                    ConvertToEntitySet(
                        entitySet,
                        providerManifest,
                        convertedItemCache,
                        newGlobalItems));
            }

            // Populate with converted relationship set objects
            foreach (var relationshipSet in element.RelationshipSets)
            {
                Debug.Assert(
                    relationshipSet.Relationship.RelationshipKind == RelationshipKind.Association,
                    "We do not support containment set");

                entityContainer.AddEntitySetBase(
                    ConvertToAssociationSet(
                        relationshipSet,
                        providerManifest,
                        convertedItemCache,
                        entityContainer,
                        newGlobalItems));
            }

            // Populate with converted function imports
            foreach (var functionImport in element.FunctionImports)
            {
                entityContainer.AddFunctionImport(
                    ConvertToFunction(
                        functionImport,
                        providerManifest, convertedItemCache, entityContainer, newGlobalItems));
            }

            // Extract the optional Documentation
            if (element.Documentation != null)
            {
                entityContainer.Documentation = ConvertToDocumentation(element.Documentation);
            }

            AddOtherContent(element, entityContainer);

            return entityContainer;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:63,代码来源:Converter.cs



注:本文中的System.Data.Entity.Core.Common.DbProviderManifest类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommandTrees.DbCommandTree类代码示例发布时间:2022-05-26
下一篇:
C# Entity.AdventureWorksModelBuilder类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap