コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Shopper" /> class.
 /// </summary>
 /// <param name="Title">The shopper&#39;s title.</param>
 /// <param name="FirstName">The shopper&#39;s first name (required).</param>
 /// <param name="LastName">The shopper&#39;s last name (required).</param>
 /// <param name="MiddleName">The shopper&#39;s middle name.</param>
 /// <param name="Phone">The shopper&#39;s contact phone number.</param>
 /// <param name="Email">The shopper&#39;s email address (required).</param>
 /// <param name="BirthDate">The shopper&#39;s birth date in the form yyyy-mm-dd.</param>
 /// <param name="Gender">The shopper&#39;s gender.</param>
 /// <param name="Statistics">Statistics.</param>
 /// <param name="BillingAddress">BillingAddress (required).</param>
 public Shopper(string Title = default(string), string FirstName = default(string), string LastName = default(string), string MiddleName = default(string), string Phone = default(string), string Email = default(string), DateTime?BirthDate = default(DateTime?), GenderEnum?Gender = default(GenderEnum?), ShopperStatistics Statistics = default(ShopperStatistics), OrderAddress BillingAddress = default(OrderAddress))
 {
     // to ensure "FirstName" is required (not null)
     if (FirstName == null)
     {
         throw new InvalidDataException("FirstName is a required property for Shopper and cannot be null");
     }
     else
     {
         this.FirstName = FirstName;
     }
     // to ensure "LastName" is required (not null)
     if (LastName == null)
     {
         throw new InvalidDataException("LastName is a required property for Shopper and cannot be null");
     }
     else
     {
         this.LastName = LastName;
     }
     // to ensure "Email" is required (not null)
     if (Email == null)
     {
         throw new InvalidDataException("Email is a required property for Shopper and cannot be null");
     }
     else
     {
         this.Email = Email;
     }
     // to ensure "BillingAddress" is required (not null)
     if (BillingAddress == null)
     {
         throw new InvalidDataException("BillingAddress is a required property for Shopper and cannot be null");
     }
     else
     {
         this.BillingAddress = BillingAddress;
     }
     this.Title      = Title;
     this.MiddleName = MiddleName;
     this.Phone      = Phone;
     this.BirthDate  = BirthDate;
     this.Gender     = Gender;
     this.Statistics = Statistics;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderShipping" /> class.
 /// </summary>
 /// <param name="Pickup">States if the shipping method is pickup, otherwise the shipping address should be provided.</param>
 /// <param name="Tracking">Tracking.</param>
 /// <param name="Address">Address.</param>
 public OrderShipping(bool?Pickup = default(bool?), OrderShippingTracking Tracking = default(OrderShippingTracking), OrderAddress Address = default(OrderAddress))
 {
     this.Pickup   = Pickup;
     this.Tracking = Tracking;
     this.Address  = Address;
 }