mirror of
https://github.com/Biarity/Sieve.git
synced 2025-07-27 04:33:23 +02:00
Set up Nullable Test
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Sieve.Attributes;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace SieveTests.Entities
|
||||
[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);
|
||||
|
||||
@@ -23,5 +24,8 @@ namespace SieveTests.Entities
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
[Column(TypeName = "datetime")]
|
||||
public DateTime DateLastViewed { get; set; } = DateTime.UtcNow;
|
||||
|
||||
[Sieve(CanFilter = true, CanSort = true)]
|
||||
public int? CategoryId { get; set; } = new Random().Next(0, 4);
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,8 @@ namespace SieveTests.Migrations
|
||||
CommentCount = table.Column<int>(nullable: false),
|
||||
DateCreated = table.Column<DateTimeOffset>(nullable: false),
|
||||
LikeCount = table.Column<int>(nullable: false),
|
||||
Title = table.Column<string>(nullable: true)
|
||||
Title = table.Column<string>(nullable: true),
|
||||
CategoryId = table.Column<int>(nullable: true)
|
||||
},
|
||||
constraints: table => table.PrimaryKey("PK_Posts", x => x.Id));
|
||||
}
|
||||
|
@@ -34,6 +34,8 @@ namespace SieveTests.Migrations
|
||||
|
||||
b.Property<int>("LikeCount");
|
||||
|
||||
b.Property<int?>("CategoryId");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
Reference in New Issue
Block a user