TableOrViewMetadata <AbstractObjectName, AbstractDbType> DatabaseObjectAsTableOrView <TObject>(OperationType operationType)
        {
            var databaseObject = DatabaseMetadata.GetDatabaseObjectFromClass <TObject>(operationType);

            if (databaseObject is TableOrViewMetadata <AbstractObjectName, AbstractDbType> table)
            {
                return(table);
            }
            else if (databaseObject is StoredProcedureMetadata <AbstractObjectName, AbstractDbType> )
            {
                throw new ArgumentException($"Table or view expected. Use `Procedure<TObject>(value, OperationType.{operationType})` instead.");
            }
            else if (databaseObject is TableFunctionMetadata <AbstractObjectName, AbstractDbType> )
            {
                throw new ArgumentException($"Table or view expected. Use `TableFunction<TObject>(value, OperationType.{operationType})` instead.");
            }
            else if (databaseObject is ScalarFunctionMetadata <AbstractObjectName, AbstractDbType> )
            {
                throw new ArgumentException($"Table or view expected. Use `ScalarFunction<TObject>(value, OperationType.{operationType})` instead.");
            }
            else
            {
                throw new NotSupportedException($"Unexpected type {databaseObject.GetType()}");
            }
        }