Added edit modal
This commit is contained in:
@@ -14,4 +14,6 @@ public class Post {
|
||||
|
||||
[ForeignKey("author")]
|
||||
public User? Author { get; set; }
|
||||
|
||||
public bool Published { get; set; }
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user