本文整理汇总了C#中Core.RequiresImport方法的典型用法代码示例。如果您正苦于以下问题:C# Core.RequiresImport方法的具体用法?C# Core.RequiresImport怎么用?C# Core.RequiresImport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core.RequiresImport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateItemLinks
/// <summary>
/// Generates the Data source links when a specific data source
/// is being returned
/// </summary>
/// <param name="dataSource">the data source for which the links are generated</param>
/// <returns>Collectino of Links</returns>
public IEnumerable<Link> GenerateItemLinks(Core.Model.DataSource dataSource)
{
// Add links if the datasource needs and import to update the aggregated data.
var links = new List<Link>();
if (dataSource.RequiresImport())
{
links.Add(new Link
{
Rel = "import",
Href = "/api/import/" + dataSource.Id,
Title = string.Empty,
Type = "method=\"PUT\""
});
links.Add(new Link
{
Rel = "import",
Href = "/api/datasource/" + dataSource.Id + "/import/",
Title = string.Empty,
Type = "method=\"PUT\""
});
}
// Add a link back to the DataSources
links.Add(new Link()
{
Href = "/api/windfarm/",
Rel = "windfarms",
Title = string.Empty,
Type = "method=\"GET\""
});
// Add one linking back to the DataTypes
links.Add(new Link()
{
Href = "/api/datatype/",
Rel = "datatypes",
Title = string.Empty,
Type = "method=\"GET\""
});
return links;
}