protected MetadataProvider(SqlAliasContainerBuilder aliasContainerBuilder) { if (aliasContainerBuilder == null) { throw new ArgumentNullException(nameof(aliasContainerBuilder)); } if (aliasContainerBuilder.RegisteredAliases?.Any() != true) { throw new ArgumentException("RegisteredAliases contains no elements"); } _aliasContainer = new SqlAliasContainer(aliasContainerBuilder.RegisteredAliases); }
public static void Initialize(SqlAliasContainerBuilder aliasContainerBuilder) { if (aliasContainerBuilder == null) { throw new ArgumentNullException(nameof(aliasContainerBuilder)); } if (aliasContainerBuilder.RegisteredAliases?.Any() != true) { throw new ArgumentException("RegisteredAliases contains no elements"); } var provider = Instance as MetadataProvider; if (provider == null) { throw new InvalidOperationException("The method supports only the default metadata provider"); } provider._aliasContainer = new SqlAliasContainer(aliasContainerBuilder.RegisteredAliases); }