2018-05-28 03:32:21 +02:00
|
|
|
|
using System;
|
2018-05-24 01:19:36 +02:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2018-01-27 06:20:57 +01:00
|
|
|
|
using Sieve.Attributes;
|
|
|
|
|
|
2021-05-13 14:04:18 +02:00
|
|
|
|
namespace Sieve.Sample.Entities
|
2018-01-27 06:20:57 +01:00
|
|
|
|
{
|
2019-11-17 00:15:07 +01:00
|
|
|
|
public class Post
|
2018-01-27 06:20:57 +01:00
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[Sieve(CanFilter = true, CanSort = true)]
|
2021-05-13 14:04:18 +02:00
|
|
|
|
public string Title { get; set; } = Guid.NewGuid().ToString().Replace("-", string.Empty)[..8];
|
2018-01-27 06:20:57 +01:00
|
|
|
|
|
|
|
|
|
[Sieve(CanFilter = true, CanSort = true)]
|
|
|
|
|
public int LikeCount { get; set; } = new Random().Next(0, 1000);
|
|
|
|
|
|
2018-05-28 03:32:21 +02:00
|
|
|
|
|
2018-01-27 06:20:57 +01:00
|
|
|
|
[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;
|
2018-05-24 01:19:36 +02:00
|
|
|
|
|
|
|
|
|
[Sieve(CanFilter = true, CanSort = true)]
|
|
|
|
|
[Column(TypeName = "datetime")]
|
|
|
|
|
public DateTime DateLastViewed { get; set; } = DateTime.UtcNow;
|
2018-05-28 03:32:21 +02:00
|
|
|
|
|
|
|
|
|
[Sieve(CanFilter = true, CanSort = true)]
|
|
|
|
|
public int? CategoryId { get; set; } = new Random().Next(0, 4);
|
2018-01-27 06:20:57 +01:00
|
|
|
|
}
|
|
|
|
|
}
|