More product setup
This commit is contained in:
19
AobaCore/AobaService.cs
Normal file
19
AobaCore/AobaService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using AobaV2.Models;
|
||||
|
||||
using MaybeError;
|
||||
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace AobaCore;
|
||||
|
||||
public class AobaService(IMongoDatabase db)
|
||||
{
|
||||
private readonly IMongoCollection<Media> _media = db.GetCollection<Media>("media");
|
||||
|
||||
|
||||
public async Task<Media?> GetMediaAsync(ObjectId id)
|
||||
{
|
||||
return await _media.Find(m => m.Id == id).FirstOrDefaultAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user