本文整理汇总了C#中Nancy.NancyContext.ApplyODataUriFilter方法的典型用法代码示例。如果您正苦于以下问题:C# NancyContext.ApplyODataUriFilter方法的具体用法?C# NancyContext.ApplyODataUriFilter怎么用?C# NancyContext.ApplyODataUriFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nancy.NancyContext
的用法示例。
在下文中一共展示了NancyContext.ApplyODataUriFilter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSeries
/*
*
*/
public static IEnumerable<Comic> GetSeries(BCRUser user, Guid id, NancyContext context)
{
var books = ComicRackWebViewer.Plugin.Application.GetLibraryBooks();
var book = books.Where(x => x.Id == id).First();
var series = books.Where(x => x.ShadowSeries == book.ShadowSeries)
.Where(x => x.ShadowVolume == book.ShadowVolume)
.Select(x => x.ToComic(user))
.OrderBy(x => x.ShadowNumber).ToList();
int totalCount = 0;
return context.ApplyODataUriFilter(series, ref totalCount).Cast<Comic>();
}
示例2: GetSeries
public static List GetSeries(Guid id, NancyContext context)
{
var books = Plugin.Application.GetLibraryBooks();
var book = books.Where(x => x.Id == id).First();
var series = books.Where(x => x.Series == book.Series)
.Where(x => x.Volume == book.Volume)
.Select(x => x.ToComic())
.OrderBy(x => x.Number).ToList();
return new List
{
Comics = context.ApplyODataUriFilter(series).Cast<Comic>(),
Name = book.Series
};
}
示例3: GetIssuesOfList
public static List GetIssuesOfList(string name, NancyContext context)
{
var list = GetLists(Program.Database.ComicLists).FirstOrDefault(x => x.Name == name);
if (list == null)
{
return new List
{
Comics = Enumerable.Empty<Comic>(),
Name = name
};
}
return new List
{
Comics = context.ApplyODataUriFilter(list.GetBooks().Select(x => x.ToComic())).Cast<Comic>(),
Name = name
};
}