public Task <ApiProjection> GetAlert <ApiProjection>(int id, ProjectTo <ApiProjection> projectDel) { var excludeMongoID = Builders <Alert> .Projection.Exclude(x => x.MongoID); return(Alerts.Find(x => x.ID == id).Project(x => projectDel(x)).FirstOrDefaultAsync()); }
public Task <List <ApiProjection> > GetAllAlerts <ApiProjection>(ProjectTo <ApiProjection> projectDel) { var excludeMongoID = Builders <Alert> .Projection.Exclude(x => x.MongoID); return(Alerts.Find(x => true).Project(x => projectDel(x)).ToListAsync()); }