public PresidentStateFilter(string state) { _state = new Name(state); }
public PersonFullName(Name surname, params Name[] givenNames) { Surname = surname; GivenNames = givenNames; }
private static void DoParse(string value, out PersonFullName result, out System.Exception exception) { if (string.IsNullOrWhiteSpace(value)) { result = null; exception = new FormatException("Value is null, empty or whitespace."); return; } string[] parts = value.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries); if (parts.Length < 2) { result = null; exception = new FormatException("Full name shall have at least 2 names."); return; } var surname = new Name(parts.Last()); IEnumerable<Name> givenNames = parts.Take(parts.Length - 1).Select(name => new Name(name)); result = new PersonFullName(surname, givenNames.ToArray()); exception = null; }
private bool Equals(Name other) { return string.Equals(_name, other._name, StringComparison.OrdinalIgnoreCase); }