public static TryCreate ( string webAddress, |
||
webAddress | string | |
result | ||
failureReason | string | |
return | bool |
public static bool TryCreate(string webAddress, out WebAddress result, out string failureReason)
{
var specification = new WebAddressSpecification();
if (specification.IsSatisfiedBy(webAddress))
{
result = new WebAddress(webAddress);
failureReason = string.Empty;
return true;
}
result = null;
failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine();
return false;
}