本文整理汇总了C#中Microsoft.OData.Core.ODataFeed.GetAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C# ODataFeed.GetAnnotation方法的具体用法?C# ODataFeed.GetAnnotation怎么用?C# ODataFeed.GetAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Core.ODataFeed
的用法示例。
在下文中一共展示了ODataFeed.GetAnnotation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitFeed
/// <summary>
/// Visits a feed item.
/// </summary>
/// <param name="feed">The feed to visit.</param>
protected override ODataPayloadElement VisitFeed(ODataFeed feed)
{
ODataPayloadElement payloadElement = base.VisitFeed(feed);
ODataFeedPayloadOrderObjectModelAnnotation payloadOrderFeedAnnotation = feed.GetAnnotation<ODataFeedPayloadOrderObjectModelAnnotation>();
if (payloadOrderFeedAnnotation != null)
{
PayloadOrderODataPayloadElementAnnotation payloadOrderElementAnnotation = new PayloadOrderODataPayloadElementAnnotation();
payloadOrderElementAnnotation.PayloadItems.AddRange(payloadOrderFeedAnnotation.PayloadItems);
payloadElement.Add(payloadOrderElementAnnotation);
}
return payloadElement;
}
开发者ID:larsenjo,项目名称:odata.net,代码行数:17,代码来源:ObjectModelToPayloadElementPayloadWithPayloadOrderConverter.cs
示例2: CreateFeed
/// <summary>
/// Creates the materializer feed.
/// </summary>
/// <param name="feed">The feed.</param>
/// <param name="entries">The entries.</param>
/// <returns>The materializer feed.</returns>
public static MaterializerFeed CreateFeed(ODataFeed feed, IEnumerable<ODataEntry> entries)
{
Debug.Assert(feed.GetAnnotation<IEnumerable<ODataEntry>>() == null, "Feed state has already been created.");
if (entries == null)
{
entries = Enumerable.Empty<ODataEntry>();
}
else
{
feed.SetAnnotation<IEnumerable<ODataEntry>>(entries);
}
return new MaterializerFeed(feed, entries);
}
示例3: WriteFeed
private void WriteFeed(ODataWriter writer, Lazy<ODataReader> lazyReader, ODataFeed feed)
{
this.WriteStart(writer, feed);
var annotation = feed.GetAnnotation<ODataFeedEntriesObjectModelAnnotation>();
if (annotation != null)
{
int count = annotation.Count;
for (int i = 0; i < count; ++i)
{
this.WriteEntry(writer, lazyReader, annotation[i]);
}
}
this.WriteEnd(writer, ODataReaderState.FeedEnd);
this.Read(lazyReader);
}
示例4: VisitFeed
/// <summary>
/// Visits a feed item.
/// </summary>
/// <param name="feed">The feed item to visit.</param>
/// <returns>An ODataPayloadElement representing the feed.</returns>
protected override ODataPayloadElement VisitFeed(ODataFeed feed)
{
ExceptionUtilities.CheckArgumentNotNull(feed, "feed");
EntitySetInstance entitySet = (EntitySetInstance)base.VisitFeed(feed);
var atomMetadata = feed.GetAnnotation<AtomFeedMetadata>();
if (atomMetadata != null)
{
ConvertAtomFeedMetadata(atomMetadata, entitySet);
}
return entitySet;
}
示例5: GetFeed
/// <summary>
/// Gets the materializer feed.
/// </summary>
/// <param name="feed">The feed.</param>
/// <returns>The materializer feed.</returns>
public static MaterializerFeed GetFeed(ODataFeed feed)
{
IEnumerable<ODataEntry> entries = feed.GetAnnotation<IEnumerable<ODataEntry>>();
return new MaterializerFeed(feed, entries);
}
示例6: WriteFeed
private void WriteFeed(ODataWriter writer, ODataFeed feed)
{
writer.WriteStart(feed);
var annotation = feed.GetAnnotation<ODataFeedEntriesObjectModelAnnotation>();
if (annotation != null)
{
foreach (var entry in annotation)
{
this.WriteEntry(writer, entry);
}
}
writer.WriteEnd();
}
示例7: VisitFeed
/// <summary>
/// Visits a feed item.
/// </summary>
/// <param name="feed">The feed to visit.</param>
protected override void VisitFeed(ODataFeed feed)
{
this.VisitAtomMetadata(feed.GetAnnotation<AtomFeedMetadata>());
base.VisitFeed(feed);
}