mirror of
https://github.com/Biarity/Sieve.git
synced 2025-07-27 04:33:23 +02:00
OrderByDynamic is modified to be able to handle inherited members, such as interface members.
SieveProcessor is modified to pass propertyInfo to OrderByDynamic to avoid reattainment of propertyInfo required in Expression.MakeMemberAccess. SieveProcessor is modified to be able to handle possible multiple incompatible customMethods via AggregateException. Corresponding interfaces are generated for entities with related inheritance. ApplicationSieveProcessor is modified to include interface members. SieveCustomFilterMethods and SieveCustomSortMethod are modified to include interface related custom method modifications. Interface accessed unit tests are added.
This commit is contained in:
10
SieveUnitTests/Abstractions/Entity/IBaseEntity.cs
Normal file
10
SieveUnitTests/Abstractions/Entity/IBaseEntity.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace SieveUnitTests.Abstractions.Entity
|
||||
{
|
||||
public interface IBaseEntity
|
||||
{
|
||||
int Id { get; set; }
|
||||
DateTimeOffset DateCreated { get; set; }
|
||||
}
|
||||
}
|
7
SieveUnitTests/Abstractions/Entity/IComment.cs
Normal file
7
SieveUnitTests/Abstractions/Entity/IComment.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace SieveUnitTests.Abstractions.Entity
|
||||
{
|
||||
public interface IComment: IBaseEntity
|
||||
{
|
||||
string Text { get; set; }
|
||||
}
|
||||
}
|
24
SieveUnitTests/Abstractions/Entity/IPost.cs
Normal file
24
SieveUnitTests/Abstractions/Entity/IPost.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Sieve.Attributes;
|
||||
using SieveUnitTests.Entities;
|
||||
|
||||
namespace SieveUnitTests.Abstractions.Entity
|
||||
{
|
||||
public interface IPost: IBaseEntity
|
||||
{
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
string Title { get; set; }
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
int LikeCount { get; set; }
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
int CommentCount { get; set; }
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
int? CategoryId { get; set; }
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
bool IsDraft { get; set; }
|
||||
string ThisHasNoAttribute { get; set; }
|
||||
string ThisHasNoAttributeButIsAccessible { get; set; }
|
||||
int OnlySortableViaFluentApi { get; set; }
|
||||
Comment TopComment { get; set; }
|
||||
Comment FeaturedComment { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user