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


C# EdmPrimitiveTypeKind类代码示例

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


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

示例1: BadPrimitiveType

 public BadPrimitiveType(string qualifiedName, EdmPrimitiveTypeKind primitiveKind, IEnumerable<EdmError> errors)
     : base(errors)
 {
     this.primitiveKind = primitiveKind;
     qualifiedName = qualifiedName ?? string.Empty;
     EdmUtil.TryGetNamespaceNameFromQualifiedName(qualifiedName, out this.namespaceName, out this.name);
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:7,代码来源:BadPrimitiveType.cs

示例2: PrimitiveType

 private PrimitiveType(Type clrType, string edmTypeName, EdmPrimitiveTypeKind primitiveKind, PrimitiveTypeConverter typeConverter, bool hasReverseMapping)
 {
     this.ClrType = clrType;
     this.EdmTypeName = edmTypeName;
     this.primitiveKind = primitiveKind;
     this.TypeConverter = typeConverter;
     this.HasReverseMapping = hasReverseMapping;
 }
开发者ID:nickchal,项目名称:pash,代码行数:8,代码来源:PrimitiveType.cs

示例3: EdmPrimitiveType

 public EdmPrimitiveType(EdmPrimitiveTypeKind kind)
 {
     this.PrimitiveKind = kind;
     this.Namespace = "namespace";
     this.Name = "name";
     this.SchemaElementKind = EdmSchemaElementKind.None;
     this.TypeKind = EdmTypeKind.None;
 }
开发者ID:TomDu,项目名称:odata.net,代码行数:8,代码来源:UtilsTests.cs

示例4: GetODataSerializer_Primitive

        public void GetODataSerializer_Primitive(Type type, EdmPrimitiveTypeKind edmPrimitiveTypeKind)
        {
            var serializerProvider = new DefaultODataSerializerProvider(_edmModel);
            var serializer = serializerProvider.GetODataPayloadSerializer(type);

            Assert.NotNull(serializer);
            var primitiveSerializer = Assert.IsType<ODataPrimitiveSerializer>(serializer);
            Assert.Equal(primitiveSerializer.EdmType.AsPrimitive().PrimitiveKind(), edmPrimitiveTypeKind);
            Assert.Equal(primitiveSerializer.ODataPayloadKind, ODataPayloadKind.Property);
        }
开发者ID:marojeri,项目名称:aspnetwebstack,代码行数:10,代码来源:DefaultODataSerializerProviderTests.cs

示例5: GetODataSerializer_Primitive

        public void GetODataSerializer_Primitive(Type type, EdmPrimitiveTypeKind primitiveKind)
        {
            ODataDeserializerProvider deserializerProvider = new DefaultODataDeserializerProvider(_edmModel);
            ODataDeserializer deserializer = deserializerProvider.GetODataDeserializer(type);

            Assert.NotNull(deserializer);
            ODataRawValueDeserializer rawValueDeserializer = Assert.IsType<ODataRawValueDeserializer>(deserializer);
            Assert.Equal(ODataPayloadKind.Value, rawValueDeserializer.ODataPayloadKind);
            Assert.Equal(primitiveKind, rawValueDeserializer.PrimitiveTypeReference.PrimitiveDefinition().PrimitiveKind);
        }
开发者ID:chrisortman,项目名称:aspnetwebstack,代码行数:10,代码来源:DefaultODataDeserializerProviderTests.cs

示例6: GetODataDeserializer_Primitive

        public void GetODataDeserializer_Primitive(Type type, EdmPrimitiveTypeKind primitiveKind)
        {
            ODataDeserializerProvider deserializerProvider = new DefaultODataDeserializerProvider();
            ODataDeserializer deserializer = deserializerProvider.GetODataDeserializer(_edmModel, type);

            Assert.NotNull(deserializer);
            ODataPrimitiveDeserializer rawValueDeserializer = Assert.IsType<ODataPrimitiveDeserializer>(deserializer);
            Assert.Equal(ODataPayloadKind.Property, rawValueDeserializer.ODataPayloadKind);
            Assert.Equal(primitiveKind, rawValueDeserializer.EdmType.AsPrimitive().PrimitiveDefinition().PrimitiveKind);
        }
开发者ID:balajivasudevan,项目名称:aspnetwebstack,代码行数:10,代码来源:DefaultODataDeserializerProviderTests.cs

示例7: GetODataSerializer_Primitive

        public void GetODataSerializer_Primitive(Type type, EdmPrimitiveTypeKind edmPrimitiveTypeKind)
        {
            var serializerProvider = new DefaultODataSerializerProvider();
            HttpRequestMessage request = new HttpRequestMessage();
            var serializer = serializerProvider.GetODataPayloadSerializer(_edmModel, type, request);

            Assert.NotNull(serializer);
            var primitiveSerializer = Assert.IsType<ODataPrimitiveSerializer>(serializer);
            Assert.Equal(primitiveSerializer.ODataPayloadKind, ODataPayloadKind.Property);
        }
开发者ID:KevMoore,项目名称:aspnetwebstack,代码行数:10,代码来源:DefaultODataSerializerProviderTests.cs

示例8: PromotesTo

		private static bool PromotesTo(this EdmPrimitiveTypeKind startingKind, EdmPrimitiveTypeKind target)
		{
			if (startingKind == target)
			{
				return true;
			}
			else
			{
				return ExpressionTypeChecker.promotionMap[(int)startingKind, (int)target];
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:11,代码来源:ExpressionTypeChecker.cs

示例9: GetODataDeserializer_Primitive

        public void GetODataDeserializer_Primitive(Type type, EdmPrimitiveTypeKind primitiveKind)
        {
            ODataDeserializerProvider deserializerProvider = new DefaultODataDeserializerProvider();
            HttpRequestMessage request = new HttpRequestMessage();

            ODataDeserializer deserializer = deserializerProvider.GetODataDeserializer(_edmModel, type, request);

            Assert.NotNull(deserializer);
            ODataPrimitiveDeserializer rawValueDeserializer = Assert.IsType<ODataPrimitiveDeserializer>(deserializer);
            Assert.Equal(ODataPayloadKind.Property, rawValueDeserializer.ODataPayloadKind);
        }
开发者ID:normalian,项目名称:aspnetwebstack,代码行数:11,代码来源:DefaultODataDeserializerProviderTests.cs

示例10: BadPrimitiveType

		public BadPrimitiveType(string qualifiedName, EdmPrimitiveTypeKind primitiveKind, IEnumerable<EdmError> errors) : base(errors)
		{
			this.primitiveKind = primitiveKind;
			string str = qualifiedName;
			string empty = str;
			if (str == null)
			{
				empty = string.Empty;
			}
			qualifiedName = empty;
			EdmUtil.TryGetNamespaceNameFromQualifiedName(qualifiedName, out this.namespaceName, out this.name);
		}
开发者ID:nickchal,项目名称:pash,代码行数:12,代码来源:BadPrimitiveType.cs

示例11: Constructor_SucceedsForValidPrimitiveType

        public void Constructor_SucceedsForValidPrimitiveType(EdmPrimitiveTypeKind primitiveTypeKind)
        {
            IEdmPrimitiveType edmPrimitiveType = EdmCoreModel.Instance.SchemaElements
                                                                .OfType<IEdmPrimitiveType>()
                                                                .Where(primitiveType => primitiveType.PrimitiveKind == primitiveTypeKind)
                                                                .FirstOrDefault();
            IEdmPrimitiveTypeReference edmPrimitiveTypeReference = new EdmPrimitiveTypeReference(edmPrimitiveType, false);

            var serializer = new ODataPrimitiveSerializer(edmPrimitiveTypeReference);

            Assert.Equal(serializer.EdmType, edmPrimitiveTypeReference);
            Assert.Equal(serializer.ODataPayloadKind, ODataPayloadKind.Property);
        }
开发者ID:chrisortman,项目名称:aspnetwebstack,代码行数:13,代码来源:ODataPrimitiveSerializerTests.cs

示例12: PromotesTo

 private static bool PromotesTo(this EdmPrimitiveTypeKind startingKind, EdmPrimitiveTypeKind target)
 {
     return startingKind == target || promotionMap[(int)startingKind, (int)target];
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:4,代码来源:ExpressionTypeChecker.cs

示例13: GetInputHtmlType

 private string GetInputHtmlType(EdmPrimitiveTypeKind kind) {
     switch (kind) {
         case EdmPrimitiveTypeKind.Boolean:
             return "checkbox";
         case EdmPrimitiveTypeKind.Int32:
         case EdmPrimitiveTypeKind.Double:
             return "number";
         default:
             return "text";
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:11,代码来源:AddAzureServiceDialog.xaml.cs

示例14: GetDefaultValue

 private static string GetDefaultValue(EdmPrimitiveTypeKind type) {
     switch (type) {
         case EdmPrimitiveTypeKind.String:
             return "'0'";
         case EdmPrimitiveTypeKind.Double:
             return "0.0";
         case EdmPrimitiveTypeKind.Int32:
             return "0";
         case EdmPrimitiveTypeKind.Boolean:
             return "False";
         default:
             throw new InvalidOperationException();
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:14,代码来源:AddAzureServiceDialog.xaml.cs

示例15: AddStructuralProperty

 /// <summary>
 /// Creates and adds a nullable structural property to this type.
 /// </summary>
 /// <param name="name">Name of the property.</param>
 /// <param name="type">Type of the property.</param>
 /// <param name="isNullable">Flag specifying if the property is nullable.</param>
 /// <returns>Created structural property.</returns>
 public EdmStructuralProperty AddStructuralProperty(string name, EdmPrimitiveTypeKind type, bool isNullable)
 {
     EdmStructuralProperty property = new EdmStructuralProperty(this, name, EdmCoreModel.Instance.GetPrimitive(type, isNullable));
     this.AddProperty(property);
     return property;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:13,代码来源:EdmStructuredType.cs


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