15 lines
384 B
C#
15 lines
384 B
C#
using models.Core;
|
|
using MongoDB.Driver;
|
|
|
|
namespace data.Tickets;
|
|
|
|
public class Find
|
|
{
|
|
public Ticket Execute(string ticketId)
|
|
{
|
|
var database = MongoFactory.GetDatabase();
|
|
var collection = database.GetCollection<Ticket>("tickets");
|
|
var filter = Builders<Ticket>.Filter.Eq("Id", ticketId);
|
|
return collection.Find(filter).FirstOrDefault();
|
|
}
|
|
} |