mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-24 22:42:30 +01:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System;
|
|
using Sieve.Attributes;
|
|
|
|
namespace SieveUnitTests.Entities
|
|
{
|
|
public class Post
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
[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 DateTimeOffset DateCreated { get; set; } = DateTimeOffset.UtcNow;
|
|
|
|
[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; }
|
|
}
|
|
}
|