예제 #1
0
 private Person ImmutableWith(T4Immutable.WithParam <string> firstName = default(T4Immutable.WithParam <string>), T4Immutable.WithParam <string> lastName = default(T4Immutable.WithParam <string>), T4Immutable.WithParam <int> age = default(T4Immutable.WithParam <int>))
 {
     return(new Person(
                !firstName.HasValue ? this.FirstName : firstName.Value,
                !lastName.HasValue ? this.LastName : lastName.Value,
                !age.HasValue ? this.Age : age.Value
                ));
 }
예제 #2
0
 public Person With(T4Immutable.WithParam <string> firstName = default(T4Immutable.WithParam <string>), T4Immutable.WithParam <string> lastName = default(T4Immutable.WithParam <string>), T4Immutable.WithParam <int> age = default(T4Immutable.WithParam <int>))
 {
     return(ImmutableWith(firstName, lastName, age));
 }