mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-22 21:42:38 +01:00
863d75bdc1
* Modular configuration for property mappings * Update Readme, unit tests and sample Co-authored-by: Steven Decoodt <steven.decoodt@vinci-energies.net>
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Sieve.Services;
|
|
|
|
namespace SieveUnitTests.Abstractions.Entity
|
|
{
|
|
public class SieveConfigurationForIPost : ISieveConfiguration
|
|
{
|
|
public void Configure(SievePropertyMapper mapper)
|
|
{
|
|
mapper.Property<IPost>(p => p.ThisHasNoAttributeButIsAccessible)
|
|
.CanSort()
|
|
.CanFilter()
|
|
.HasName("shortname");
|
|
|
|
mapper.Property<IPost>(p => p.TopComment.Text)
|
|
.CanFilter();
|
|
|
|
mapper.Property<IPost>(p => p.TopComment.Id)
|
|
.CanSort();
|
|
|
|
mapper.Property<IPost>(p => p.OnlySortableViaFluentApi)
|
|
.CanSort();
|
|
|
|
mapper.Property<IPost>(p => p.TopComment.Text)
|
|
.CanFilter()
|
|
.HasName("topc");
|
|
|
|
mapper.Property<IPost>(p => p.FeaturedComment.Text)
|
|
.CanFilter()
|
|
.HasName("featc");
|
|
|
|
mapper
|
|
.Property<IPost>(p => p.DateCreated)
|
|
.CanSort()
|
|
.HasName("CreateDate");
|
|
}
|
|
}
|
|
}
|