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


C# IEdmEntityTypeReference类代码示例

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


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

示例1: WriteElementEpm

 private void WriteElementEpm(XmlWriter writer, EpmTargetPathSegment targetSegment, EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference entityType, ref string alreadyDeclaredPrefix)
 {
     string prefix = targetSegment.SegmentNamespacePrefix ?? string.Empty;
     writer.WriteStartElement(prefix, targetSegment.SegmentName, targetSegment.SegmentNamespaceUri);
     if (prefix.Length > 0)
     {
         WriteNamespaceDeclaration(writer, targetSegment, ref alreadyDeclaredPrefix);
     }
     foreach (EpmTargetPathSegment segment in targetSegment.SubSegments)
     {
         if (segment.IsAttribute)
         {
             this.WriteAttributeEpm(writer, segment, epmValueCache, entityType, ref alreadyDeclaredPrefix);
         }
     }
     if (targetSegment.HasContent)
     {
         string str2 = this.GetEntryPropertyValueAsText(targetSegment, epmValueCache, entityType);
         ODataAtomWriterUtils.WriteString(writer, str2);
     }
     else
     {
         foreach (EpmTargetPathSegment segment2 in targetSegment.SubSegments)
         {
             if (!segment2.IsAttribute)
             {
                 this.WriteElementEpm(writer, segment2, epmValueCache, entityType, ref alreadyDeclaredPrefix);
             }
         }
     }
     writer.WriteEndElement();
 }
开发者ID:nickchal,项目名称:pash,代码行数:32,代码来源:EpmCustomWriter.cs

示例2: Get

 public static void Get(
     string dataSourceName,
     IEdmEntityTypeReference entityType,
     EdmEntityObjectCollection collection)
 {
     GetDataSource(dataSourceName).Get(entityType, collection);
 }
开发者ID:nickgoodrow,项目名称:ODataSamples,代码行数:7,代码来源:DataSourceProvider.cs

示例3: CreatingEntityInstanceContextAsync

		protected override async Task CreatingEntityInstanceContextAsync(object entity, IEdmEntityTypeReference entityType, object graph, ODataSerializerContext writeContext)
		{
			if (entity is Customer)
			{
				await PreProcessCustomerAsync(entity as Customer);
			}
			await base.CreatingEntityInstanceContextAsync(entity, entityType, graph, writeContext);
		}
开发者ID:joshcomley,项目名称:WebApi,代码行数:8,代码来源:SampleODataSerializerProvider.cs

示例4: EntityRangeVariable

 /// <summary>
 /// Creates a <see cref="EntityRangeVariable"/>.
 /// </summary>
 /// <param name="name"> The name of the associated any/all parameter (null if none)</param>
 /// <param name="entityType">The entity type of each item in the collection that this range variable iterates over.</param>
 /// <param name="navigationSource">The navigation source of the collection this node iterates over.</param>
 /// <exception cref="System.ArgumentNullException">Throws if the input name or entityType is null.</exception>
 public EntityRangeVariable(string name, IEdmEntityTypeReference entityType, IEdmNavigationSource navigationSource)
 {
     ExceptionUtils.CheckArgumentNotNull(name, "name");
     ExceptionUtils.CheckArgumentNotNull(entityType, "entityType");
     this.name = name;
     this.entityTypeReference = entityType;
     this.entityCollectionNode = null;
     this.navigationSource = navigationSource;
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:16,代码来源:EntityRangeVariable.cs

示例5: GetEntryPropertyValueAsText

 private string GetEntryPropertyValueAsText(EpmTargetPathSegment targetSegment, EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference entityType)
 {
     object propertyValue = base.ReadEntryPropertyValue(targetSegment.EpmInfo, epmValueCache, entityType);
     if (propertyValue == null)
     {
         return string.Empty;
     }
     return EpmWriterUtils.GetPropertyValueAsText(propertyValue);
 }
开发者ID:nickchal,项目名称:pash,代码行数:9,代码来源:EpmCustomWriter.cs

示例6: WriteAttributeEpm

 private void WriteAttributeEpm(XmlWriter writer, EpmTargetPathSegment targetSegment, EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference entityType, ref string alreadyDeclaredPrefix)
 {
     string str = this.GetEntryPropertyValueAsText(targetSegment, epmValueCache, entityType);
     string prefix = targetSegment.SegmentNamespacePrefix ?? string.Empty;
     writer.WriteAttributeString(prefix, targetSegment.AttributeName, targetSegment.SegmentNamespaceUri, str);
     if (prefix.Length > 0)
     {
         WriteNamespaceDeclaration(writer, targetSegment, ref alreadyDeclaredPrefix);
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:10,代码来源:EpmCustomWriter.cs

示例7: Get

 public void Get(IEdmEntityTypeReference entityType, EdmEntityObjectCollection collection)
 {
     EdmEntityObject entity = new EdmEntityObject(entityType);
     entity.TrySetPropertyValue("Name", "Foo");
     entity.TrySetPropertyValue("ID", 100);
     collection.Add(entity);
     entity = new EdmEntityObject(entityType);
     entity.TrySetPropertyValue("Name", "Bar");
     entity.TrySetPropertyValue("ID", 101);
     collection.Add(entity);
 }
开发者ID:nickgoodrow,项目名称:ODataSamples,代码行数:11,代码来源:AnotherDataSource.cs

示例8: ValidateEntityTypeIsAssignable

        /// <summary>
        /// Validates that the <paramref name="payloadEntityTypeReference"/> is assignable to the <paramref name="expectedEntityTypeReference"/>
        /// and fails if it's not.
        /// </summary>
        /// <param name="expectedEntityTypeReference">The expected entity type reference, the base type of the entities expected.</param>
        /// <param name="payloadEntityTypeReference">The payload entity type reference to validate.</param>
        internal static void ValidateEntityTypeIsAssignable(IEdmEntityTypeReference expectedEntityTypeReference, IEdmEntityTypeReference payloadEntityTypeReference)
        {
            Debug.Assert(expectedEntityTypeReference != null, "expectedEntityTypeReference != null");
            Debug.Assert(payloadEntityTypeReference != null, "payloadEntityTypeReference != null");

            // Entity types must be assignable
            if (!EdmLibraryExtensions.IsAssignableFrom(expectedEntityTypeReference.EntityDefinition(), payloadEntityTypeReference.EntityDefinition()))
            {
                throw new ODataException(Strings.ValidationUtils_EntryTypeNotAssignableToExpectedType(payloadEntityTypeReference.ODataFullName(), expectedEntityTypeReference.ODataFullName()));
            }
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:17,代码来源:ValidationUtils.cs

示例9: EntityInstanceContext

        private EntityInstanceContext(ODataSerializerContext serializerContext, IEdmEntityTypeReference entityType, IEdmStructuredObject edmObject)
        {
            if (serializerContext == null)
            {
                throw Error.ArgumentNull("serializerContext");
            }

            SerializerContext = serializerContext;
            EntityType = entityType.EntityDefinition();
            EdmObject = edmObject;
        }
开发者ID:karensyc,项目名称:aspnetwebstack,代码行数:11,代码来源:EntityInstanceContext.cs

示例10: EntityInstanceContext

        private EntityInstanceContext(ODataSerializerContext serializerContext, IEdmEntityTypeReference entityType, IEdmEntityObject edmObject, string assemblyName)
        {
            if (serializerContext == null)
            {
                throw Error.ArgumentNull("serializerContext");
            }

	        AssemblyName = assemblyName;
            SerializerContext = serializerContext;
            EntityType = entityType.EntityDefinition();
            EdmObject = edmObject;
        }
开发者ID:joshcomley,项目名称:WebApi,代码行数:12,代码来源:EntityInstanceContext.cs

示例11: WriteEntryEpm

 private void WriteEntryEpm(XmlWriter writer, EpmTargetTree epmTargetTree, EntryPropertiesValueCache epmValueCache, IEdmEntityTypeReference entityType)
 {
     EpmTargetPathSegment nonSyndicationRoot = epmTargetTree.NonSyndicationRoot;
     if (nonSyndicationRoot.SubSegments.Count != 0)
     {
         foreach (EpmTargetPathSegment segment2 in nonSyndicationRoot.SubSegments)
         {
             string alreadyDeclaredPrefix = null;
             this.WriteElementEpm(writer, segment2, epmValueCache, entityType, ref alreadyDeclaredPrefix);
         }
     }
 }
开发者ID:nickchal,项目名称:pash,代码行数:12,代码来源:EpmCustomWriter.cs

示例12: WriteEntryEpm

        /// <summary>
        /// Writes the custom mapped EPM properties to an XML writer which is expected to be positioned such to write
        /// a child element of the entry element.
        /// </summary>
        /// <param name="writer">The XmlWriter to write to.</param>
        /// <param name="epmTargetTree">The EPM target tree to use.</param>
        /// <param name="epmValueCache">The entry properties value cache to use to access the properties.</param>
        /// <param name="entityType">The type of the entry.</param>
        /// <param name="atomOutputContext">The output context currently in use.</param>
        internal static void WriteEntryEpm(
            XmlWriter writer,
            EpmTargetTree epmTargetTree,
            EntryPropertiesValueCache epmValueCache,
            IEdmEntityTypeReference entityType,
            ODataAtomOutputContext atomOutputContext)
        {
            DebugUtils.CheckNoExternalCallers();

            EpmCustomWriter epmWriter = new EpmCustomWriter(atomOutputContext);
            epmWriter.WriteEntryEpm(writer, epmTargetTree, epmValueCache, entityType);
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:21,代码来源:EpmCustomWriter.cs

示例13: WriteEntryEpm

        /// <summary>
        /// Writes the syndication part of EPM for an entry into ATOM metadata OM.
        /// </summary>
        /// <param name="epmTargetTree">The EPM target tree to use.</param>
        /// <param name="epmValueCache">The entry properties value cache to use to access the properties.</param>
        /// <param name="type">The type of the entry.</param>
        /// <param name="atomOutputContext">The output context currently in use.</param>
        /// <returns>The ATOM metadata OM with the EPM values populated.</returns>
        internal static AtomEntryMetadata WriteEntryEpm(
            EpmTargetTree epmTargetTree,
            EntryPropertiesValueCache epmValueCache,
            IEdmEntityTypeReference type,
            ODataAtomOutputContext atomOutputContext)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(epmTargetTree != null, "epmTargetTree != null");
            Debug.Assert(epmValueCache != null, "epmValueCache != null");
            Debug.Assert(type != null, "For any EPM to exist the metadata must be available.");

            EpmSyndicationWriter epmWriter = new EpmSyndicationWriter(epmTargetTree, atomOutputContext);
            return epmWriter.WriteEntryEpm(epmValueCache, type);
        }
开发者ID:smasonuk,项目名称:odata-sparql,代码行数:22,代码来源:EpmSyndicationWriter.cs

示例14: ReadFeed

        /// <summary>
        /// Deserializes the given <paramref name="feed"/> under the given <paramref name="readContext"/>.
        /// </summary>
        /// <param name="feed">The feed to deserialize.</param>
        /// <param name="readContext">The deserializer context.</param>
        /// <param name="elementType">The element type of the feed being read.</param>
        /// <returns>The deserialized feed object.</returns>
        public virtual IEnumerable ReadFeed(ODataFeedWithEntries feed, IEdmEntityTypeReference elementType, ODataDeserializerContext readContext)
        {
            ODataEdmTypeDeserializer deserializer = DeserializerProvider.GetEdmTypeDeserializer(elementType);
            if (deserializer == null)
            {
                throw new SerializationException(
                    Error.Format(SRResources.TypeCannotBeDeserialized, elementType.FullName(), typeof(ODataMediaTypeFormatter).Name));
            }

            foreach (ODataEntryWithNavigationLinks entry in feed.Entries)
            {
                yield return deserializer.ReadInline(entry, elementType, readContext);
            }
        }
开发者ID:huangw-t,项目名称:aspnetwebstack,代码行数:21,代码来源:ODataFeedDeserializer.cs

示例15: Get

        public void Get(IEdmEntityTypeReference entityType, EdmEntityObjectCollection collection)
        {
            EdmEntityObject entity = new EdmEntityObject(entityType);
            entity.TrySetPropertyValue("Name", "Foo");
            entity.TrySetPropertyValue("ID", 100);
            entity.TrySetPropertyValue("School", Createchool(99, new DateTimeOffset(2016, 1, 19, 1, 2, 3, TimeSpan.Zero), entity.ActualEdmType));
            collection.Add(entity);

            entity = new EdmEntityObject(entityType);
            entity.TrySetPropertyValue("Name", "Bar");
            entity.TrySetPropertyValue("ID", 101);
            entity.TrySetPropertyValue("School", Createchool(99, new DateTimeOffset(1978, 11, 15, 1, 2, 3, TimeSpan.Zero), entity.ActualEdmType));

            collection.Add(entity);
        }
开发者ID:chinadragon0515,项目名称:ODataSamples,代码行数:15,代码来源:AnotherDataSource.cs


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