当前位置: 首页>>代码示例>>C#>>正文


C# Type.NestingNamespace方法代码示例

本文整理汇总了C#中Type.NestingNamespace方法的典型用法代码示例。如果您正苦于以下问题:C# Type.NestingNamespace方法的具体用法?C# Type.NestingNamespace怎么用?C# Type.NestingNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Type的用法示例。


在下文中一共展示了Type.NestingNamespace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: ClrEntityType

        /// <summary>
        ///     Initializes a new instance of Complex Type with properties from the type.
        /// </summary>
        /// <param name="type"> The CLR type to construct from </param>
        internal ClrEntityType(Type type, string cspaceNamespaceName, string cspaceTypeName)
            : base(Check.NotNull(type, "type").Name, type.NestingNamespace() ?? string.Empty,
                DataSpace.OSpace)
        {
            DebugCheck.NotEmpty(cspaceNamespaceName);
            DebugCheck.NotEmpty(cspaceTypeName);

            _type = type;
            _cspaceNamespaceName = cspaceNamespaceName;
            _cspaceTypeName = cspaceNamespaceName + "." + cspaceTypeName;
            Abstract = type.IsAbstract;
        }
开发者ID:hallco978,项目名称:entityframework,代码行数:16,代码来源:ClrEntityType.cs

示例3: EnumType

        // <summary>
        // Initializes a new instance of the EnumType class from CLR enumeration type.
        // </summary>
        // <param name="clrType"> CLR enumeration type to create EnumType from. </param>
        // <remarks>
        // Note that this method expects that the <paramref name="clrType" /> is a valid CLR enum type
        // whose underlying type is a valid EDM primitive type.
        // Ideally this constructor should be protected and internal (Family and Assembly modifier) but
        // C# does not support this. In order to not expose this constructor to everyone internal is the
        // only option.
        // </remarks>
        internal EnumType(Type clrType)
            :
                base(clrType.Name, clrType.NestingNamespace() ?? string.Empty, DataSpace.OSpace)
        {
            DebugCheck.NotNull(clrType);
            Debug.Assert(clrType.IsEnum(), "enum type expected");

            ClrProviderManifest.Instance.TryGetPrimitiveType(clrType.GetEnumUnderlyingType(), out _underlyingType);

            Debug.Assert(_underlyingType != null, "only primitive types expected here.");
            Debug.Assert(
                Helper.IsSupportedEnumUnderlyingType(_underlyingType.PrimitiveTypeKind),
                "unsupported CLR types should have been filtered out by .TryGetPrimitiveType() method.");

            _isFlags = clrType.GetCustomAttributes<FlagsAttribute>(inherit: false).Any();

            foreach (var name in Enum.GetNames(clrType))
            {
                AddMember(
                    new EnumMember(
                        name,
                        Convert.ChangeType(Enum.Parse(clrType, name), clrType.GetEnumUnderlyingType(), CultureInfo.InvariantCulture)));
            }
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:35,代码来源:EnumType.cs

示例4: ClrComplexType

        /// <summary>
        ///     Initializes a new instance of Complex Type with properties from the type.
        /// </summary>
        /// <param name="clrType"> The CLR type to construct from </param>
        internal ClrComplexType(Type clrType, string cspaceNamespaceName, string cspaceTypeName)
            : base(Check.NotNull(clrType, "clrType").Name, clrType.NestingNamespace() ?? string.Empty,
                DataSpace.OSpace)
        {
            DebugCheck.NotEmpty(cspaceNamespaceName);
            DebugCheck.NotEmpty(cspaceTypeName);

            _type = clrType;
            _cspaceTypeName = cspaceNamespaceName + "." + cspaceTypeName;
            Abstract = clrType.IsAbstract;
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:15,代码来源:ComplexType.cs

示例5: MetadataPropertyAttribute

 /// <summary>
 ///     Initialize a new attribute with complex type kind (corresponding the the CLR type)
 /// </summary>
 /// <param name="type"> CLR type setting Type property </param>
 /// <param name="isCollection"> Sets IsCollectionType property </param>
 internal MetadataPropertyAttribute(Type type, bool isCollection)
     : this(ClrComplexType.CreateReadonlyClrComplexType(type, type.NestingNamespace() ?? string.Empty, type.Name), isCollection)
 {
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:9,代码来源:MetadataPropertyAttribute.cs


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