ticket-system/source/ticketAPI/data/Events/GetAll.cs
2024-12-05 16:47:23 -05:00

15 lines
304 B
C#

using models.Core;
using MongoDB.Driver;
namespace data.Events;
public class GetAll
{
public List<Event> Execute()
{
var database = MongoFactory.GetDatabase();
var collection = database.GetCollection<Event>("events");
return collection.Find(_ => true).ToList();
}
}