Beispiel #1
0
 public AppInfoDbo[] GetAll()
 {
     return(AppInfos
            .Find(_ => true)
            .ToList()
            .ToArray());
 }
Beispiel #2
0
        public AppInfoDbo Find(string id)
        {
            var filterEq = Builders <AppInfoDbo> .Filter.Eq(x => x.Id, id);

            return(AppInfos
                   .Find(filterEq)
                   .SingleOrDefault());
        }
Beispiel #3
0
        public void AddOrUpdate(AppInfoDbo dbo)
        {
            var filterEq = Builders <AppInfoDbo> .Filter.Eq(x => x.Id, dbo.Id);

            dbo.LastUpdatedAt = DateTimeOffset.Now;

            AppInfos
            .FindOneAndReplace(filterEq, dbo, new FindOneAndReplaceOptions <AppInfoDbo> {
                IsUpsert = true
            });
        }