mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-24 14:33:01 +01:00
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using Microsoft.Extensions.Options;
|
|
using Sieve.Models;
|
|
using Sieve.Services;
|
|
using SieveUnitTests.Entities;
|
|
|
|
namespace SieveUnitTests.Services
|
|
{
|
|
public class ApplicationSieveProcessor : SieveProcessor
|
|
{
|
|
public ApplicationSieveProcessor(
|
|
IOptions<SieveOptions> options,
|
|
ISieveCustomSortMethods customSortMethods,
|
|
ISieveCustomFilterMethods customFilterMethods)
|
|
: base(options, customSortMethods, customFilterMethods)
|
|
{
|
|
}
|
|
|
|
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
|
|
{
|
|
mapper.Property<Post>(p => p.ThisHasNoAttributeButIsAccessible)
|
|
.CanSort()
|
|
.CanFilter()
|
|
.HasName("shortname");
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Text)
|
|
.CanFilter();
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Id)
|
|
.CanSort();
|
|
|
|
mapper.Property<Post>(p => p.OnlySortableViaFluentApi)
|
|
.CanSort();
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Text)
|
|
.CanFilter()
|
|
.HasName("topc");
|
|
|
|
mapper.Property<Post>(p => p.FeaturedComment.Text)
|
|
.CanFilter()
|
|
.HasName("featc");
|
|
|
|
return mapper;
|
|
}
|
|
}
|
|
}
|