Пример #1
0
        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());
        }
Пример #2
0
        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());
        }