Sieve/SieveUnitTests/Services/ApplicationSieveProcessor.cs

32 lines
913 B
C#
Raw Normal View History

2018-02-10 06:37:04 +01:00
using Microsoft.Extensions.Options;
using Sieve.Models;
using Sieve.Services;
using SieveUnitTests.Entities;
namespace SieveUnitTests.Services
{
2018-05-15 01:34:37 +02:00
public class ApplicationSieveProcessor : SieveProcessor
2018-02-10 06:37:04 +01:00
{
2018-02-10 07:10:50 +01:00
public ApplicationSieveProcessor(
2018-05-15 01:34:37 +02:00
IOptions<SieveOptions> options,
ISieveCustomSortMethods customSortMethods,
ISieveCustomFilterMethods customFilterMethods)
2018-02-10 07:10:50 +01:00
: base(options, customSortMethods, customFilterMethods)
2018-02-10 06:37:04 +01:00
{
}
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
{
mapper.Property<Post>(p => p.ThisHasNoAttributeButIsAccessible)
.CanSort()
.CanFilter()
.HasName("shortname");
mapper.Property<Post>(p => p.OnlySortableViaFluentApi)
.CanSort();
return mapper;
}
}
}