using Microsoft.Extensions.Options; using Sieve.Models; using Sieve.Services; using SieveUnitTests.Abstractions.Entity; using SieveUnitTests.Entities; namespace SieveUnitTests.Services { public class ApplicationSieveProcessor : SieveProcessor { public ApplicationSieveProcessor( IOptions options, ISieveCustomSortMethods customSortMethods, ISieveCustomFilterMethods customFilterMethods) : base(options, customSortMethods, customFilterMethods) { } protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper) { mapper.Property(p => p.ThisHasNoAttributeButIsAccessible) .CanSort() .CanFilter() .HasName("shortname"); mapper.Property(p => p.TopComment.Text) .CanFilter(); mapper.Property(p => p.TopComment.Id) .CanSort(); mapper.Property(p => p.OnlySortableViaFluentApi) .CanSort(); mapper.Property(p => p.TopComment.Text) .CanFilter() .HasName("topc"); mapper.Property(p => p.FeaturedComment.Text) .CanFilter() .HasName("featc"); mapper .Property(p => p.DateCreated) .CanSort() .HasName("CreateDate"); // interfaces mapper.Property(p => p.ThisHasNoAttributeButIsAccessible) .CanSort() .CanFilter() .HasName("shortname"); mapper.Property(p => p.TopComment.Text) .CanFilter(); mapper.Property(p => p.TopComment.Id) .CanSort(); mapper.Property(p => p.OnlySortableViaFluentApi) .CanSort(); mapper.Property(p => p.TopComment.Text) .CanFilter() .HasName("topc"); mapper.Property(p => p.FeaturedComment.Text) .CanFilter() .HasName("featc"); mapper .Property(p => p.DateCreated) .CanSort() .HasName("CreateDate"); return mapper; } } }