/// <summary>
        /// Retrieves the resolved schema-qualified name for an object type.
        /// </summary>
        /// <param name="dialect">A dialect that the name should be qualified for.</param>
        /// <param name="database">The database that an object should be qualified for.</param>
        /// <param name="type">The type of object that the attribute is applied to.</param>
        /// <returns>A schema-qualified name for a database object.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="dialect"/>, <paramref name="database"/>, or <paramref name="type"/> is <c>null</c></exception>
        public static Identifier GetQualifiedNameOrDefault(this IDatabaseDialect dialect, IRelationalDatabase database, Type type)
        {
            if (dialect == null)
            {
                throw new ArgumentNullException(nameof(dialect));
            }
            if (database == null)
            {
                throw new ArgumentNullException(nameof(dialect));
            }
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            var schemaName = dialect.GetSchemaOverride(type);

            if (schemaName.IsNullOrWhiteSpace())
            {
                schemaName = database.IdentifierDefaults.Schema;
            }

            var localName = dialect.GetAliasOrDefault(type);

            return(Identifier.CreateQualifiedIdentifier(schemaName, localName));
        }