public async Task <(Reservation, Copy)> GetReservationToBorrow(ReaderId readerId, ReservationId reservationId) { var reservation = await GetReservation(reservationId, readerId); var copy = await GetCopy(reservation.CopyId, reservationId); return(reservation, copy); }
public async Task <Reservation> GetReservation(ReservationId reservationId, ReaderId readerId) { var iterator = _container.GetItemLinqQueryable <CosmosDocument <Reservation> >() .Where(x => x.PartitionKey == this._partitionKey) .Where(x => x.Data.ReaderId == readerId.Value && x.Data.ReservationId == reservationId.Value) .Take(1) .ToFeedIterator(); var reservationDocument = await iterator.GetFirst(); _modifiedDocuments.Add(reservationDocument); return(reservationDocument.Data); }
public ReadingStream GetReadingStreamFor(ReaderId reader) { var readingStream = _readingStreamView.Query.SingleOrDefault(s => s.Reader == reader); return readingStream ?? new ReadingStream(reader); }
public ReadingStream(ReaderId reader, IEnumerable<Chirp> chirps) : base(chirps) { Reader = reader; }
public ReadingStream(ReaderId reader) { Reader = reader; }