Sieve/SieveUnitTests/Services/ApplicationSieveProcessor.cs

38 lines
1.3 KiB
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.Abstractions.Entity;
2018-02-10 06:37:04 +01:00
using SieveUnitTests.Entities;
namespace SieveUnitTests.Services
{
2019-11-17 00:15:07 +01: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
{
}
public SieveOptions ExposedOptions => new SieveOptions()
2018-02-10 06:37:04 +01:00
{
IgnoreNullsOnNotEqual = Options.Value.IgnoreNullsOnNotEqual,
CaseSensitive = Options.Value.CaseSensitive,
DefaultPageSize = Options.Value.DefaultPageSize,
DisableNullableTypeExpressionForSorting = Options.Value.DisableNullableTypeExpressionForSorting,
MaxPageSize = Options.Value.MaxPageSize,
ThrowExceptions = Options.Value.ThrowExceptions,
};
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
{
SieveConfigurationForPost.ConfigureStatic(mapper);
SieveConfigurationForIPost.ConfigureStatic(mapper);
2018-02-10 06:37:04 +01:00
return mapper;
}
}
}