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 }); }
public async Task DeleteOnGoingBook(OnGoingBook onGoing) { await OnGoingBooks.DeleteOneAsync(book => book.UserId == onGoing.UserId && book.BookId == onGoing.BookId); }
public async Task InsertOnGoingBook(OnGoingBook onGoing) { await OnGoingBooks.InsertOneAsync(onGoing); }