コード例 #1
0
        public InternalOnGoingModel ConvertMongoToInternalOnGoingBook(OnGoingBook mongoOnGoingModel)
        {
            var updates = new List <InternalUpdateLog>();

            foreach (var mongoUpdateLog in mongoOnGoingModel.Updates)
            {
                updates.Add(MongoToInternalLog(mongoUpdateLog));
            }

            return(new InternalOnGoingModel
            {
                BookId = mongoOnGoingModel.BookId,
                UserId = mongoOnGoingModel.UserId,
                LastUpdate = MongoToInternalLog(mongoOnGoingModel.LastUpdate),
                Updates = updates
            });
        }
コード例 #2
0
 public async Task DeleteOnGoingBook(OnGoingBook onGoing)
 {
     await OnGoingBooks.DeleteOneAsync(book => book.UserId == onGoing.UserId && book.BookId == onGoing.BookId);
 }
コード例 #3
0
 public async Task InsertOnGoingBook(OnGoingBook onGoing)
 {
     await OnGoingBooks.InsertOneAsync(onGoing);
 }