public EntityAddress(string name, string suffix) { Name = name; Suffix = suffix; HasSuffix = !string.IsNullOrWhiteSpace(Suffix); HasConnectionString = ConnectionStringInternal.TryParse(Suffix, out var _); }
public EntityAddress(string value) { if (string.IsNullOrWhiteSpace(value)) { throw new ArgumentException("Entity address value can't be empty", nameof(value)); } var splitByAt = value.Split(seperators); if (splitByAt.Length == 1) { Name = splitByAt[0]; Suffix = string.Empty; } else { Name = splitByAt[0]; Suffix = splitByAt[splitByAt.Length - 1]; } HasSuffix = !string.IsNullOrWhiteSpace(Suffix); HasConnectionString = ConnectionStringInternal.TryParse(Suffix, out var _); }