mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-22 13:32:33 +01:00
36 lines
1016 B
C#
36 lines
1016 B
C#
using Microsoft.Extensions.Options;
|
|
using Sieve.Models;
|
|
using Sieve.Services;
|
|
using SieveUnitTests.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
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.OnlySortableViaFluentApi)
|
|
.CanSort();
|
|
|
|
return mapper;
|
|
}
|
|
}
|
|
}
|