Ejemplo n.º 1
0
 /// <summary>
 /// Sets times/options without propogating changes. If AircraftTotalTime's target is edited, no
 /// changes will be made to it.
 /// </summary>
 public void SetConfiguration(AircraftTimes times, AircraftOptions opts)
 {
     if (IsDispatched)
     {
         throw new EditWhileDispatchedException(Id, nameof(SetConfiguration));
     }
     Options = opts;
     Times   = times;
     this.Validate();
     DomainEvents.Add(new AircraftTimesChangedDomainEvent(Times));
 }
Ejemplo n.º 2
0
        }                        // Required by EF Core

        public Aircraft(string id, string model, int year, int places, AircraftTimes times,
                        AircraftOptions opts)
        {
            Id = id;
            SetRequiredDetails(model, year, places);
            IsGrounded    = false;
            IsSoftDeleted = false;
            IsActive      = false;
            opts.SetId(id);
            times.SetId(id);
            Options = opts;
            Times   = times;
            this.Validate();
        }