本文整理匯總了C#中System.Net.Http.HttpRequestMessage.ResolveLink方法的典型用法代碼示例。如果您正苦於以下問題:C# HttpRequestMessage.ResolveLink方法的具體用法?C# HttpRequestMessage.ResolveLink怎麽用?C# HttpRequestMessage.ResolveLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Net.Http.HttpRequestMessage
的用法示例。
在下文中一共展示了HttpRequestMessage.ResolveLink方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetCollection
public static Collection GetCollection(IEnumerable<Topic> topics, HttpRequestMessage request)
{
var eventsCollection = new Collection();
foreach (var topic in topics)
{
var item = new Item();
item.Href = request.ResolveLink<TopicLink>(TopicLinkHelper.TopicByIdRoute, new { id = topic.Id }).Target;
item.Data.Add(new Data { Name = "Title", Value = topic.Name });
item.Links.Add(SessionsLinkHelper.CreateLink(request,topic).ToCJLink());
eventsCollection.Items.Add(item);
}
return eventsCollection;
}
示例2: CreateLink
public static SessionLink CreateLink(HttpRequestMessage request, Session session)
{
return request.ResolveLink<SessionLink>(SessionByIdRoute, new { id = session.Id});
}
示例3: CreateLink
public static SessionsLink CreateLink(HttpRequestMessage request, Topic topic)
{
return request.ResolveLink<SessionsLink>(TopicSessionsRoute, new { id = topic.Id });
}
示例4: CreateLink
public static DaysLink CreateLink(HttpRequestMessage request)
{
return request.ResolveLink<DaysLink>(AllDaysRoute);
}
示例5: CreateLink
public static TopicLink CreateLink(HttpRequestMessage request, Topic session)
{
return request.ResolveLink<TopicLink>(TopicByIdRoute, new { id = session.Id});
}
示例6: CreateLink
public static SpeakersLink CreateLink(HttpRequestMessage request)
{
return request.ResolveLink<SpeakersLink>(SpeakersSearchRoute, "{?speakername}");
}
示例7: CreateLink
public static SpeakerLink CreateLink(HttpRequestMessage request, int speakerId)
{
return request.ResolveLink<SpeakerLink>(SpeakerByIdRoute, new { id = speakerId });
}
示例8: CreateLink
public static TopicsLink CreateLink(HttpRequestMessage request, Session session)
{
return request.ResolveLink<TopicsLink>(SessionTopicsRoute, new { id = session.Id });
}