Removed Template

This commit is contained in:
2025-01-16 16:43:46 +01:00
parent 3dde278955
commit 4908947217
6 changed files with 33 additions and 32 deletions

View File

@@ -12,13 +12,13 @@ public class Post {
public required string Caption { get; set; }
public required string Content { get; set; }
[ForeignKey("author")]
public User? Author { get; set; }
public virtual required User Author { get; set; }
public bool Published { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.Now;
public DateOnly Created { get; set; }

View File

@@ -4,7 +4,7 @@ namespace HopFrame.Testing.Models;
public class User {
[Key]
public required Guid Id { get; init; }
public required Guid Id { get; init; } = Guid.CreateVersion7();
public required string Email { get; init; }
public string? Username { get; set; }
public string? Password { get; set; }

View File

@@ -32,8 +32,7 @@ builder.Services.AddHopFrame(options => {
.SetDisplayName("Last Name");
table.Property(u => u.Id)
.Sortable(false)
.ValueTemplate(Guid.CreateVersion7);
.Sortable(false);
table.SetDisplayName("Benutzer");
});
@@ -47,8 +46,7 @@ builder.Services.AddHopFrame(options => {
.SetDisplayName("ID");
context.Table<Post>()
.Property(p => p.CreatedAt)
.ValueTemplate(() => DateTime.UtcNow);
.Property(p => p.CreatedAt);
context.Table<Post>()
.Property(p => p.Caption)