Ejemplo n.º 1
0
 public void RegisterProduct(ProductId Id, IEnumerable<FareZone> FareZones)
 {
     Guard.Against<TooManyFareZonesException>(FareZones.Count() > 3);
     Guard.Against<DuplicateProductIdException>(Queries.IdExists(Id));
     if (Id == ProductId.Empty) Id = ProductIdGenerator.Next();
     Changes.ProductRegistered(Id);
 }
Ejemplo n.º 2
0
 public void RegisterSubscription(ProductId Id, IEnumerable<FareZone> FareZones, PaymentSchedule Schedule)
 {
     Guard.With<PaymentScheduleRequiredException>(Schedule != PaymentSchedule.Empty);
     RegisterProduct(Id, FareZones);
 }
Ejemplo n.º 3
0
 bool IQueryACatalog.IdExists(ProductId Id)
 {
     return RegisteredProductIds.Contains(Id);
 }
Ejemplo n.º 4
0
 void IChangeACatalog.ProductRegistered(ProductId Id)
 {
     RegisteredProductIds.Add(Id);
 }