2018-02-10 06:37:04 +01:00
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Sieve.Models;
|
|
|
|
|
using Sieve.Services;
|
2020-11-03 10:42:41 +01:00
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-22 23:11:34 +01:00
|
|
|
|
public SieveOptions ExposedOptions => new SieveOptions()
|
2018-02-10 06:37:04 +01:00
|
|
|
|
{
|
2023-02-22 23:11:34 +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,
|
|
|
|
|
};
|
2020-11-03 10:42:41 +01:00
|
|
|
|
|
2023-02-22 23:11:34 +01:00
|
|
|
|
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
|
|
|
|
|
{
|
|
|
|
|
SieveConfigurationForPost.ConfigureStatic(mapper);
|
|
|
|
|
SieveConfigurationForIPost.ConfigureStatic(mapper);
|
2020-11-03 10:42:41 +01:00
|
|
|
|
|
2018-02-10 06:37:04 +01:00
|
|
|
|
return mapper;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|