C
C#2y ago
MayoWAA!

❔ AntDesign List Problem

I'm making a site for my school for students to give suggestions that get saved to a mongodb database, I've sorted that part out but i want admins to be able to see and delete the suggestions if they are inappropriate but it isn't work
<AntList DataSource="@submissions">
<ItemTemplate>
@foreach (var item in _submissionObjects)
{
<AntListItem>
<AntListItemMeta
Title="@item.Username"
Description="@item.Suggestion"/>
</AntListItem>
}
</ItemTemplate>
</AntList>
<AntList DataSource="@submissions">
<ItemTemplate>
@foreach (var item in _submissionObjects)
{
<AntListItem>
<AntListItemMeta
Title="@item.Username"
Description="@item.Suggestion"/>
</AntListItem>
}
</ItemTemplate>
</AntList>
private MongoClient client;
private IMongoCollection<BsonDocument> collection;
bool IsEmpty;
public List<BsonDocument> submissions;

Index.SubmissionObject[] _submissionObjects;

private async Task NoticeWithIcon(string message, string description, NotificationType type)
{
await _notice.Open(new NotificationConfig()
{
Message = message,
Description = description,
NotificationType = type
});
}

protected override async Task OnInitializedAsync()
{
client = new MongoClient("connectionstring");
var db = client.GetDatabase("dbname");
var collection = db.GetCollection<BsonDocument>("collectionname");
submissions = await collection.Find(_ => true).ToListAsync();
}
private MongoClient client;
private IMongoCollection<BsonDocument> collection;
bool IsEmpty;
public List<BsonDocument> submissions;

Index.SubmissionObject[] _submissionObjects;

private async Task NoticeWithIcon(string message, string description, NotificationType type)
{
await _notice.Open(new NotificationConfig()
{
Message = message,
Description = description,
NotificationType = type
});
}

protected override async Task OnInitializedAsync()
{
client = new MongoClient("connectionstring");
var db = client.GetDatabase("dbname");
var collection = db.GetCollection<BsonDocument>("collectionname");
submissions = await collection.Find(_ => true).ToListAsync();
}
1 Reply
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server