2022-01-12 20:22:24 +01:00
|
|
|
|
using Sieve.Services;
|
|
|
|
|
|
|
|
|
|
namespace SieveUnitTests.Entities
|
|
|
|
|
{
|
|
|
|
|
public class SieveConfigurationForPost : ISieveConfiguration
|
|
|
|
|
{
|
2023-02-22 23:11:34 +01:00
|
|
|
|
public static void ConfigureStatic(SievePropertyMapper mapper)
|
2022-01-12 20:22:24 +01:00
|
|
|
|
{
|
2023-02-22 23:11:34 +01:00
|
|
|
|
mapper
|
|
|
|
|
.Property<Post>(p => p.Id)
|
|
|
|
|
.CanSort();
|
|
|
|
|
|
2022-01-12 20:22:24 +01:00
|
|
|
|
mapper.Property<Post>(p => p.ThisHasNoAttributeButIsAccessible)
|
|
|
|
|
.CanSort()
|
|
|
|
|
.CanFilter()
|
|
|
|
|
.HasName("shortname");
|
|
|
|
|
|
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Text)
|
|
|
|
|
.CanFilter();
|
|
|
|
|
|
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Id)
|
|
|
|
|
.CanSort();
|
|
|
|
|
|
|
|
|
|
mapper.Property<Post>(p => p.OnlySortableViaFluentApi)
|
|
|
|
|
.CanSort();
|
|
|
|
|
|
|
|
|
|
mapper.Property<Post>(p => p.TopComment.Text)
|
|
|
|
|
.CanFilter()
|
|
|
|
|
.HasName("topc");
|
|
|
|
|
|
|
|
|
|
mapper.Property<Post>(p => p.FeaturedComment.Text)
|
|
|
|
|
.CanFilter()
|
|
|
|
|
.HasName("featc");
|
|
|
|
|
|
|
|
|
|
mapper
|
|
|
|
|
.Property<Post>(p => p.DateCreated)
|
|
|
|
|
.CanSort()
|
|
|
|
|
.HasName("CreateDate");
|
2023-02-22 23:11:34 +01:00
|
|
|
|
|
|
|
|
|
mapper
|
|
|
|
|
.Property<Post>(post => post.DeletedBy)
|
|
|
|
|
.CanSort()
|
|
|
|
|
.HasName("DeletedBy");
|
|
|
|
|
|
|
|
|
|
mapper
|
|
|
|
|
.Property<Post>(post => post.UpdatedBy)
|
|
|
|
|
.CanFilter()
|
|
|
|
|
.HasName("UpdatedBy");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Configure(SievePropertyMapper mapper)
|
|
|
|
|
{
|
|
|
|
|
ConfigureStatic(mapper);
|
2022-01-12 20:22:24 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|