public ConcurrentPickupAddressModifier(IContainer c, string label) { _label = label; _container = c; _session = c.GetInstance <ISession>(); _repository = c.GetInstance <IReverseAuctionRepository>(); _di = c.GetInstance <IDependencies>(); _aggregate = null; }
/// <summary>EXPOSED FOR UNIT TESTING ONLY</summary> internal void ThrowIfPickupTimeRangeHasChanged( ReverseAuctionAggregate auction, Repr.Waypoint newPickup) { var current = auction.BuyerTerms.Pickup.Time; var requested = Convert.ToTimeRange(newPickup.Earliest, newPickup.Latest); if (current != requested) { throw new ArgumentException("cannot change pickup time"); } }
private Repr.ReverseAuction ToRepresentation(ReverseAuctionAggregate auction) { auction.MustNotBeNull(nameof(auction)); return(new Repr.ReverseAuction { Uri = _uriScheme.ToUri(auction).ToString(), BiddingStart = auction.BiddingAllowed.Start.ToIso8601(), BiddingEnd = auction.BiddingAllowed.End.ToIso8601(), Bids = Repr.PaginatedSequence <Repr.Bid> .Empty, Pickup = Convert.ToRepr(auction.BuyerTerms.Pickup), Dropoff = Convert.ToRepr(auction.BuyerTerms.Dropoff), OtherTerms = auction.BuyerTerms.OtherTerms, }); }
public void LoadExistingReverseAuction(int id) { _aggregate = _repository.Get(id); }
public int Save(ReverseAuctionAggregate agg) { _aggregate = agg; _repository.Save(_aggregate); return(_aggregate.Id); }
public Uri ToUri(ReverseAuctionAggregate reverseAuction) { return(new Uri($"http://example.com/ReverseAuction/{reverseAuction.Id}")); }
public ReverseAuctionAggregate Update(ReverseAuctionAggregate ra) { this.session.Update(ra.Root); return(ra); }
public Uri ToUri(ReverseAuctionAggregate reverseAuction) { // TODO: Test this. It's tough to debug because of the anonymous object. return(new Uri(_urlHelper.Link("ReverseAuction", new { reverseAuction.Id }))); }
internal BuyerTermsChanged(ReverseAuctionAggregate x) : base(x) { }
internal ReverseAuctionCreated(ReverseAuctionAggregate x) : base(x) { }
/// <summary> /// DomainEvents have <c>internal</c> constructors because they should /// only be constructed within the Domain project. Nothing outside /// the Domain should ever publish or create one. /// </summary> internal ReverseAuctionEvent(ReverseAuctionAggregate created) { Precondition.MustNotBeNull(created, nameof(created)); Id = created.Id; }