Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 public ReadingStream GetReadingStreamFor(ReaderId reader)
 {
     var readingStream = _readingStreamView.Query.SingleOrDefault(s => s.Reader == reader);
     return readingStream ?? new ReadingStream(reader);
 }
Example #4
0
 public ReadingStream(ReaderId reader, IEnumerable<Chirp> chirps) : base(chirps)
 {
     Reader = reader;
 }
Example #5
0
 public ReadingStream(ReaderId reader)
 {
     Reader = reader;
 }