private static void CreateCustomer(Guid id, int age, string firstName, string lastName, BirthDate birthDate) { try { System.Diagnostics.Debugger.Break(); Console.Out.WriteLine(new AttributedCustomer( id, age, firstName, lastName, birthDate).ToString()); } catch (ArgumentNullException) { Console.Out.WriteLine("ArgumentNullException"); } }
private static void CreateCustomerWithDefinedToString(Guid id, int age, string firstName, string lastName, BirthDate birthDate) { try { Console.Out.WriteLine(new AttributedCustomerWithDefinedToString( id, age, firstName, lastName, birthDate).ToString()); } catch (ArgumentNullException) { Console.Out.WriteLine("ArgumentNullException"); } }
public AttributedCustomer(Guid id, [NotNull] int age, [NotNull] string firstName, [NotNull] string lastName, BirthDate birthDate) : this() { this.Id = id; this.Age = age; this.FirstName = firstName; this.LastName = lastName; this.BirthDate = birthDate; }