コード例 #1
0
 public AircraftMDS AddNewAircraftMds(string name)
 {
     if (GetAllAircrafts().Any(x => x.Name.Matches(name)))
         throw new InvalidOperationException(string.Format("An aircraft with the name {0} already exists", name));
     var aircraft = new AircraftMDS()
     {
         Name = name,
         Active = true
     };
     aircraft.Validate();
     return Persist<AircraftMDS>(aircraft);
 }
コード例 #2
0
 public AircraftMDS AddAircraftMds(AircraftMDS aircraftMds)
 {
     aircraftMds.Validate();
     aircraftMds.Active = true;
     return Persist<AircraftMDS>(aircraftMds);
 }