public virtual ExtendedServiceBusNamespace CreateNamespace(string name, string location, NamespaceType type, bool createACSNamespace = false)
{
location = string.IsNullOrEmpty(location) ? GetDefaultLocation() : location;
if (!Regex.IsMatch(name, ServiceBusConstants.NamespaceNamePattern))
{
throw new ArgumentException(string.Format(Resources.InvalidNamespaceName, name), "Name");
}
ServiceBusClient.Namespaces.CreateNamespace(name, new ServiceBusNamespaceCreateParameters { Region = location, CreateACSNamespace = createACSNamespace, NamespaceType = type});
// Wait until the namespace is activated
while (!IsActiveNamespace(name))
{
Thread.Sleep(SleepDuration);
}
return GetExtendedServiceBusNamespace(name);
}