mirror of
https://github.com/Biarity/Sieve.git
synced 2025-09-20 15:19:38 +02:00
interface type fixes & unit test improvements
This commit is contained in:
@@ -10,5 +10,8 @@ namespace SieveUnitTests.Entities
|
||||
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
public DateTimeOffset DateCreated { get; set; } = DateTimeOffset.UtcNow;
|
||||
|
||||
public string DeletedBy { get; set; }
|
||||
public DateTime? DeletedAt { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -30,5 +30,10 @@ namespace SieveUnitTests.Entities
|
||||
|
||||
public Comment TopComment { get; set; }
|
||||
public Comment FeaturedComment { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
public DateTime? CreatedAt { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -4,8 +4,12 @@ namespace SieveUnitTests.Entities
|
||||
{
|
||||
public class SieveConfigurationForPost : ISieveConfiguration
|
||||
{
|
||||
public void Configure(SievePropertyMapper mapper)
|
||||
public static void ConfigureStatic(SievePropertyMapper mapper)
|
||||
{
|
||||
mapper
|
||||
.Property<Post>(p => p.Id)
|
||||
.CanSort();
|
||||
|
||||
mapper.Property<Post>(p => p.ThisHasNoAttributeButIsAccessible)
|
||||
.CanSort()
|
||||
.CanFilter()
|
||||
@@ -32,6 +36,21 @@ namespace SieveUnitTests.Entities
|
||||
.Property<Post>(p => p.DateCreated)
|
||||
.CanSort()
|
||||
.HasName("CreateDate");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user