mirror of
https://github.com/Biarity/Sieve.git
synced 2025-07-27 12:43:13 +02:00
SievePropertyMapper for #4
This commit is contained in:
28
SieveTests/Services/ApplicationSieveProcessor.cs
Normal file
28
SieveTests/Services/ApplicationSieveProcessor.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
using Sieve.Models;
|
||||
using Sieve.Services;
|
||||
using SieveTests.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SieveTests.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.Title)
|
||||
.CanSort()
|
||||
.CanFilter()
|
||||
.HasName("CustomTitleName");
|
||||
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user