Sieve/SieveUnitTests/Entities/Post.cs
Hasan a4509bb8f0
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.
2020-11-03 12:42:41 +03:00

35 lines
1.1 KiB
C#

using System;
using Sieve.Attributes;
using SieveUnitTests.Abstractions.Entity;
namespace SieveUnitTests.Entities
{
public class Post : BaseEntity, IPost
{
[Sieve(CanFilter = true, CanSort = true)]
public string Title { get; set; } = Guid.NewGuid().ToString().Replace("-", string.Empty).Substring(0, 8);
[Sieve(CanFilter = true, CanSort = true)]
public int LikeCount { get; set; } = new Random().Next(0, 1000);
[Sieve(CanFilter = true, CanSort = true)]
public int CommentCount { get; set; } = new Random().Next(0, 1000);
[Sieve(CanFilter = true, CanSort = true)]
public int? CategoryId { get; set; } = new Random().Next(0, 4);
[Sieve(CanFilter = true, CanSort = true)]
public bool IsDraft { get; set; }
public string ThisHasNoAttribute { get; set; }
public string ThisHasNoAttributeButIsAccessible { get; set; }
public int OnlySortableViaFluentApi { get; set; }
public Comment TopComment { get; set; }
public Comment FeaturedComment { get; set; }
}
}