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


C# EdmPrimitiveTypeKind.ToString方法代码示例

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


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

示例1: CreateType

 /// <summary>
 /// Creates a new instance of the IEdmPrimitiveType
 /// </summary>
 /// <param name="primitiveKind">Kind of primitive type.</param>
 /// <returns>Returns a new instance of the IEdmPrimitiveType</returns>
 public static IEdmPrimitiveType CreateType(EdmPrimitiveTypeKind primitiveKind)
 {
     Debug.Assert(primitiveKind != EdmPrimitiveTypeKind.None, "primitiveKiind != EdmPrimitiveTypeKind.None");
     return new ClientEdmPrimitiveType(XmlConstants.EdmNamespace, primitiveKind.ToString(), primitiveKind);
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:10,代码来源:PrimitiveType.cs

示例2: EdmPrimitiveType

 private EdmPrimitiveType(EdmPrimitiveTypeKind kind)
 {
     typeKind = kind;
     base.Name = kind.ToString();
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:5,代码来源:EdmPrimitiveType.cs

示例3: EnsurePrimitiveType

        /// <summary>
        /// Ensures a primitive type reference for a given primitive type kind.
        /// </summary>
        /// <param name="type">The possibly null type reference.</param>
        /// <param name="primitiveKindFromValue">The primitive type kind to ensure.</param>
        /// <returns>An <see cref="IEdmPrimitiveTypeReference"/> instance created for the <paramref name="primitiveKindFromValue"/> 
        /// if <paramref name="type"/> is null; if <paramref name="type"/> is not null, validates it and then returns it.</returns>
        private static IEdmPrimitiveTypeReference EnsurePrimitiveType(IEdmPrimitiveTypeReference type, EdmPrimitiveTypeKind primitiveKindFromValue)
        {
            if (type == null)
            {
                type = EdmCoreModel.Instance.GetPrimitive(primitiveKindFromValue, /*isNullable*/ true);
            }
            else
            {
                EdmPrimitiveTypeKind primitiveKindFromType = type.PrimitiveDefinition().PrimitiveKind;

                if (primitiveKindFromType != primitiveKindFromValue)
                {
                    string typeName = type.FullName();
                    if (typeName == null)
                    {
                        throw new ODataException(ErrorStrings.EdmValueUtils_IncorrectPrimitiveTypeKindNoTypeName(primitiveKindFromType.ToString(), primitiveKindFromValue.ToString()));
                    }

                    throw new ODataException(ErrorStrings.EdmValueUtils_IncorrectPrimitiveTypeKind(typeName, primitiveKindFromValue.ToString(), primitiveKindFromType.ToString()));
                }
            }

            return type;
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:31,代码来源:EdmValueUtils.cs

示例4: GetTypeNameFromPrimitiveTypeKind

 internal static string GetTypeNameFromPrimitiveTypeKind(EdmPrimitiveTypeKind primitiveTypeKind)
 {
     return primitiveTypeKind.ToString();
 }
开发者ID:junxy,项目名称:entityframework,代码行数:4,代码来源:XmlSchemaWriter.cs

示例5: CreateType

 public static IEdmPrimitiveType CreateType(EdmPrimitiveTypeKind primitiveKind)
 {
     return new PrimitiveType.ClientEdmPrimitiveType("Edm", primitiveKind.ToString(), primitiveKind);
 }
开发者ID:nickchal,项目名称:pash,代码行数:4,代码来源:PrimitiveType.cs


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