Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to _mapper assignment in constructor. #140

Merged
merged 1 commit into from
May 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sieve/Services/SieveProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public class SieveProcessor<TSieveModel, TFilterTerm, TSortTerm> : ISieveProcess
private const string NullFilterValue = "null";
private readonly ISieveCustomSortMethods _customSortMethods;
private readonly ISieveCustomFilterMethods _customFilterMethods;
private SievePropertyMapper _mapper;
private SievePropertyMapper Mapper => _mapper ??= MapProperties(new SievePropertyMapper());
private readonly SievePropertyMapper _mapper = new SievePropertyMapper();

public SieveProcessor(IOptions<SieveOptions> options,
ISieveCustomSortMethods customSortMethods,
ISieveCustomFilterMethods customFilterMethods)
{
_mapper = MapProperties(_mapper);
Options = options;
_customSortMethods = customSortMethods;
_customFilterMethods = customFilterMethods;
Expand All @@ -85,19 +85,22 @@ public SieveProcessor(IOptions<SieveOptions> options,
public SieveProcessor(IOptions<SieveOptions> options,
ISieveCustomSortMethods customSortMethods)
{
_mapper = MapProperties(_mapper);
Options = options;
_customSortMethods = customSortMethods;
}

public SieveProcessor(IOptions<SieveOptions> options,
ISieveCustomFilterMethods customFilterMethods)
{
_mapper = MapProperties(_mapper);
Options = options;
_customFilterMethods = customFilterMethods;
}

public SieveProcessor(IOptions<SieveOptions> options)
{
_mapper = MapProperties(_mapper);
Options = options;
}

Expand Down