Added edit modal

This commit is contained in:
Leon Hoppe
2025-01-15 14:58:15 +01:00
parent ad4d9c65d6
commit d4018cceec
12 changed files with 179 additions and 19 deletions

View File

@@ -14,4 +14,6 @@ public class Post {
[ForeignKey("author")]
public User? Author { get; set; }
public bool Published { get; set; }
}

View File

@@ -10,8 +10,4 @@ public class User {
public string? Password { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public override string ToString() {
return Id.ToString();
}
}

View File

@@ -36,9 +36,17 @@ builder.Services.AddHopFrame(options => {
.Sortable(false);
});
/* context.Table<Post>()
.Property(p => p.Author)
.DisplayedProperty(u => u!.Username); */
context.Table<Post>()
.Property(p => p.Author)
.DisplayedProperty(u => u!.Username);
.Format(user => $"{user?.FirstName} {user?.LastName}");
context.Table<Post>()
.Property(p => p.Id)
.SetDisplayName("ID")
.Editable(true);
});
});