object.ReferenceEquals(object, object)

Here are the examples of the csharp api object.ReferenceEquals(object, object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

12567 Examples 7

19 View Source File : ExprTable.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprTable? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(this.Alias, other.Alias) && this.FullName.Equals(other.FullName);
        }

19 View Source File : TableRef.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((TableRef) obj);
        }

19 View Source File : ExprAliasGuid.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return this.Equals((ExprAliasGuid) obj);
        }

19 View Source File : ExprFunctionName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprFunctionName) obj);
        }

19 View Source File : ExprColumnAlias.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprColumnAlias) obj);
        }

19 View Source File : TSqlStatementBuilder.cs
License : MIT License
Project Creator : 0x1000000

protected override void AppendColumn(TableColumn column)
        {
            column.ColumnName.Accept(this.ExprBuilder, null);
            this.Builder.Append(' ');

            column.SqlType.Accept(this.ExprBuilder, null);

            if (!column.IsNullable)
            {
                this.Builder.Append(" NOT NULL");
            }

            if (column.ColumnMeta != null)
            {
                if (column.ColumnMeta.IsIdenreplacedy)
                {
                    this.Builder.Append("  IDENreplacedY (1, 1)");
                }

                if (!ReferenceEquals(column.ColumnMeta.ColumnDefaultValue, null))
                {
                    this.Builder.Append(" DEFAULT (");
                    column.ColumnMeta.ColumnDefaultValue.Accept(this.ExprBuilder, null);
                    this.Builder.Append(')');
                }
            }
        }

19 View Source File : ExprTableFullName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprTableFullName) obj);
        }

19 View Source File : TempTableData.cs
License : MIT License
Project Creator : 0x1000000

public static TempTableData FromDerivedTableValues(ExprDerivedTableValues derivedTableValues, IReadOnlyList<ExprColumnName>? keys, Alias alias = default, string? name = null)
        {

            TempTableData result = new TempTableData(string.IsNullOrEmpty(name) || name == null ? GenerateName() : name, alias);

            var replacedyzer = new ExprValueTypereplacedyzer<TableColumn?, TempTableBuilderCtx>();

            derivedTableValues.Columns.replacedertNotEmpty("Columns list cannot be empty");
            derivedTableValues.Values.Items.replacedertNotEmpty("Rows list cannot be empty");

            TableColumn?[] tableColumns = new TableColumn?[derivedTableValues.Columns.Count];

            for (var rowIndex = 0; rowIndex < derivedTableValues.Values.Items.Count; rowIndex++)
            {
                var lastRow = rowIndex + 1 == derivedTableValues.Values.Items.Count;
                var row = derivedTableValues.Values.Items[rowIndex];
                if (row.Items.Count != derivedTableValues.Columns.Count)
                {
                    throw new SqExpressException("Number of values in a row does not match number of columns");
                }

                for (var valueIndex = 0; valueIndex < row.Items.Count; valueIndex++)
                {
                    var value = row.Items[valueIndex];
                    var previousColumn = tableColumns[valueIndex];
                    var currentColumnName = derivedTableValues.Columns[valueIndex];
                    var res = value.Accept(replacedyzer,
                        new ExprValueTypereplacedyzerCtx<TableColumn?, TempTableBuilderCtx>(
                            new TempTableBuilderCtx(
                                currentColumnName,
                                previousColumn,
                                CheckIsPk(currentColumnName)),
                            result));

                    tableColumns[valueIndex] = res;
                    if (lastRow)
                    {
                        if (ReferenceEquals(res, null))
                        {
                            throw new SqExpressException($"Could not evaluate column type at {valueIndex}");
                        }
                    }
                }
            }
            result.AddColumns(tableColumns!);

            return result;

            bool CheckIsPk(ExprColumnName columnName)
            {
                if (keys == null || keys.Count < 1)
                {
                    return false;
                }

                for (var index = 0; index < keys.Count; index++)
                {
                    var key = keys[index];

                    if (key.LowerInvariantName == columnName.LowerInvariantName)
                    {
                        return true;
                    }
                }

                return false;
            }
        }

19 View Source File : TempTableData.cs
License : MIT License
Project Creator : 0x1000000

public TableColumn VisitString(TempTableBuilderCtx arg, int? size, bool fix)
        {
            var stringTableColumn = EnsureColumnType<NullableStringTableColumn>(arg);

            if (ReferenceEquals(stringTableColumn, null))
            {
                return CreateString(size);
            }
            else
            {
                if (stringTableColumn.SqlType.GetSize().HasValue && (!size.HasValue || size.Value > stringTableColumn.SqlType.GetSize()))
                {
                    return CreateString(size);
                }
                return stringTableColumn;
            }

            NullableStringTableColumn CreateString(int? len)
            {
                return new NullableStringTableColumn(this.Alias,
                    arg.ColumnName,
                    this,
                    fix
                        ? new ExprTypeFixSizeString(len.replacedertNotNull("Length cannot be null for fixed size string"), true)
                        : new ExprTypeString(len, true, false),
                    arg.PrimaryKey ? ColumnMeta.PrimaryKey() : null);
            }
        }

19 View Source File : TempTableData.cs
License : MIT License
Project Creator : 0x1000000

public TableColumn VisitDecimal(TempTableBuilderCtx arg, DecimalPrecisionScale? decimalPrecisionScale)
        {
            var column = EnsureColumnType<NullableDecimalTableColumn>(arg);

            if (ReferenceEquals(column, null))
            {
                return CreateColumn(decimalPrecisionScale);
            }
            else
            {
                if (decimalPrecisionScale.HasValue)
                {
                    if (column.PrecisionScale.HasValue)
                    {
                        var old = column.PrecisionScale.Value;
                        var newPs = decimalPrecisionScale.Value;

                        if (old.Precision < newPs.Precision || old.Scale < newPs.Scale)
                        {
                            return CreateColumn(decimalPrecisionScale);
                        }
                    }
                }

                return column;
            }

            NullableDecimalTableColumn CreateColumn(DecimalPrecisionScale? precisionScale)
            {
                return new NullableDecimalTableColumn(this.Alias, arg.ColumnName, this, precisionScale, arg.PrimaryKey ? ColumnMeta.PrimaryKey() : null);
            }
        }

19 View Source File : ExprDbSchema.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprDbSchema) obj);
        }

19 View Source File : ExprColumnName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprColumnName) obj);
        }

19 View Source File : MySqlStatementBuilder.cs
License : MIT License
Project Creator : 0x1000000

protected override void AppendColumn(TableColumn column)
        {
            column.ColumnName.Accept(this.ExprBuilder, null);
            this.Builder.Append(' ');

            column.SqlType.Accept(this.ExprBuilder, null);

            if (!column.IsNullable)
            {
                this.Builder.Append(" NOT NULL");
            }

            if (column.ColumnMeta != null)
            {
                if (column.ColumnMeta.IsIdenreplacedy)
                {
                    this.Builder.Append(" AUTO_INCREMENT");
                }

                if (!ReferenceEquals(column.ColumnMeta.ColumnDefaultValue, null))
                {
                    this.Builder.Append(" DEFAULT (");
                    column.ColumnMeta.ColumnDefaultValue.Accept(this.ExprBuilder, null);
                    this.Builder.Append(')');
                }
            }
        }

19 View Source File : ExprNameEqualityComparer.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(IExprName? x, IExprName? y)
            {
                if (ReferenceEquals(x, y)) return true;
                if (ReferenceEquals(x, null)) return false;
                if (ReferenceEquals(y, null)) return false;
                if (x.GetType() != y.GetType()) return false;
                return x.LowerInvariantName == y.LowerInvariantName;
            }

19 View Source File : ExprXmlWriter.cs
License : MIT License
Project Creator : 0x1000000

public void EndVisitExpr(IExpr expr, XmlWriter writer)
        {
            if (ReferenceEquals(expr,this._root))
            {
                writer.WriteEndElement();
            }
            writer.Flush();
        }

19 View Source File : ExprTableAlias.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return this.Equals((ExprTableAlias) obj);
        }

19 View Source File : ExprAlias.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprAlias) obj);
        }

19 View Source File : ExprValue.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprValue) obj);
        }

19 View Source File : SqlBuilderBase.cs
License : MIT License
Project Creator : 0x1000000

protected bool VisitExprOffsetFetchCommon(ExprOffsetFetch exprOffsetFetch, IExpr? parent)
        {
            this.Builder.Append(" OFFSET ");
            exprOffsetFetch.Offset.Accept(this, exprOffsetFetch);
            this.Builder.Append(" ROW");

            if (!ReferenceEquals(exprOffsetFetch.Fetch,null))
            {
                this.Builder.Append(" FETCH NEXT ");
                exprOffsetFetch.Fetch.Accept(this, exprOffsetFetch);
                this.Builder.Append(" ROW ONLY");
            }

            return true;
        }

19 View Source File : ScAllColumnTypes.cs
License : MIT License
Project Creator : 0x1000000

private static IRecordSetterNext Mapping(IDataMapSetter<TableItAllColumnTypes, AllColumnTypesDto> s)
        {
            var recordSetterNext = s
                .Set(s.Target.ColBoolean, s.Source.ColBoolean)
                .Set(s.Target.ColNullableBoolean, s.Source.ColNullableBoolean);

            if (!ReferenceEquals(s.Target.ColByte, null))
            {
                recordSetterNext = recordSetterNext.Set(s.Target.ColByte, s.Source.ColByte);
            }

            if (!ReferenceEquals(s.Target.ColNullableByte, null))
            {
                recordSetterNext = recordSetterNext.Set(s.Target.ColNullableByte, s.Source.ColNullableByte);
            }

            recordSetterNext = recordSetterNext
                .Set(s.Target.ColInt16, s.Source.ColInt16)
                .Set(s.Target.ColNullableInt16, s.Source.ColNullableInt16)
                .Set(s.Target.ColInt32, s.Source.ColInt32)
                .Set(s.Target.ColNullableInt32, s.Source.ColNullableInt32)
                .Set(s.Target.ColInt64, s.Source.ColInt64)
                .Set(s.Target.ColNullableInt64, s.Source.ColNullableInt64)
                .Set(s.Target.ColDecimal, s.Source.ColDecimal)
                .Set(s.Target.ColNullableDecimal, s.Source.ColNullableDecimal)
                .Set(s.Target.ColDouble, s.Source.ColDouble)
                .Set(s.Target.ColNullableDouble, s.Source.ColNullableDouble)
                .Set(s.Target.ColDateTime, s.Source.ColDateTime)
                .Set(s.Target.ColNullableDateTime, s.Source.ColNullableDateTime)
                .Set(s.Target.ColGuid, s.Source.ColGuid)
                .Set(s.Target.ColNullableGuid, s.Source.ColNullableGuid)

                .Set(s.Target.ColStringMax, s.Source.ColStringMax)
                .Set(s.Target.ColNullableStringMax, s.Source.ColNullableStringMax)

                .Set(s.Target.ColStringUnicode, s.Source.ColStringUnicode)
                .Set(s.Target.ColNullableStringUnicode, s.Source.ColNullableStringUnicode)
                .Set(s.Target.ColString5, s.Source.ColString5)
                .Set(s.Target.ColByteArraySmall, s.Source.ColByteArraySmall)
                .Set(s.Target.ColNullableByteArraySmall, s.Source.ColNullableByteArraySmall)
                .Set(s.Target.ColByteArrayBig, s.Source.ColByteArrayBig)
                .Set(s.Target.ColNullableByteArrayBig, s.Source.ColNullableByteArrayBig)

                .Set(s.Target.ColFixedSizeString, s.Source.ColFixedSizeString)
                .Set(s.Target.ColNullableFixedSizeString, s.Source.ColNullableFixedSizeString)
                .Set(s.Target.ColFixedSizeByteArray, s.Source.ColFixedSizeByteArray)
                .Set(s.Target.ColNullableFixedSizeByteArray, s.Source.ColNullableFixedSizeByteArray)

                .Set(s.Target.ColXml, s.Source.ColXml)
                .Set(s.Target.ColNullableXml, s.Source.ColNullableXml)
                ;

            return recordSetterNext;
        }

19 View Source File : ExprColumn.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return this.Equals((ExprColumn) obj);
        }

19 View Source File : ExprColumnAlias.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprColumnAlias? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : ExprSchemaName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprSchemaName) obj);
        }

19 View Source File : ExprColumnName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprColumnName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : ColumnRef.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ColumnRef? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Table.Equals(other.Table) && string.Equals(this.Name, other.Name, StringComparison.InvariantCultureIgnoreCase);
        }

19 View Source File : ExprDbSchema.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprDbSchema? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(this.Database, other.Database) && this.Schema.Equals(other.Schema);
        }

19 View Source File : ExprDatabaseName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprDatabaseName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : ColumnRef.cs
License : MIT License
Project Creator : 0x1000000

public int CompareTo(ColumnRef? other)
        {
            if (ReferenceEquals(this, other)) return 0;
            if (ReferenceEquals(null, other)) return 1;
            var tableComparison = this.Table.CompareTo(other.Table);
            if (tableComparison != 0) return tableComparison;
            return string.Compare(this.Name, other.Name, StringComparison.Ordinal);
        }

19 View Source File : ExprFunctionName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprFunctionName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.BuiltIn == other.BuiltIn && this.Name == other.Name;
        }

19 View Source File : ExprTableName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprTableName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : ExprNameEqualityComparer.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(IExprName? x, IExprName? y)
            {
                if (ReferenceEquals(x, y)) return true;
                if (ReferenceEquals(x, null)) return false;
                if (ReferenceEquals(y, null)) return false;
                if (x.GetType() != y.GetType()) return false;
                return x.Name == y.Name;
            }

19 View Source File : PgSqlStatementBuilder.cs
License : MIT License
Project Creator : 0x1000000

protected override void AppendColumn(TableColumn column)
        {
            column.ColumnName.Accept(this.ExprBuilder, null);
            this.Builder.Append(' ');


            column.SqlType.Accept(this.ExprBuilder, null);

            if (!column.IsNullable)
            {
                this.Builder.Append(" NOT NULL");
            }

            if (column.ColumnMeta != null)
            {
                if (column.ColumnMeta.IsIdenreplacedy)
                {
                    this.Builder.Append("  GENERATED ALWAYS AS IDENreplacedY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 )");
                }

                if (!ReferenceEquals(column.ColumnMeta.ColumnDefaultValue, null))
                {
                    this.Builder.Append(" DEFAULT (");
                    column.ColumnMeta.ColumnDefaultValue.Accept(this.ExprBuilder, null);
                    this.Builder.Append(')');
                }
            }
        }

19 View Source File : ExprSchemaName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprSchemaName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : SqlBuilderBase.cs
License : MIT License
Project Creator : 0x1000000

public bool VisitExprOrderByOffsetFetch(ExprOrderByOffsetFetch exprOrderByOffsetFetch, IExpr? parent)
        {
            this.AcceptListComaSeparated(exprOrderByOffsetFetch.OrderList, exprOrderByOffsetFetch);

            if (parent is ExprSelectOffsetFetch exprSelectOffsetFetch && exprSelectOffsetFetch.SelectQuery is ExprQuerySpecification specification)
            {
                if (!ReferenceEquals(specification.Top, null))
                {
                    if (!ReferenceEquals(exprSelectOffsetFetch.OrderBy.OffsetFetch.Fetch, null) && exprSelectOffsetFetch.OrderBy.OffsetFetch.Fetch.Value.HasValue)
                    {
                        throw new SqExpressException("Query with \"FETCH\" cannot be limited");
                    }

                    this.AppendSelectLimit(specification.Top, exprSelectOffsetFetch);
                }
            }

            exprOrderByOffsetFetch.OffsetFetch.Accept(this, exprOrderByOffsetFetch);
            return true;
        }

19 View Source File : ExprTable.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return this.Equals((ExprTable) obj);
        }

19 View Source File : ExprAlias.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprAlias? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Name == other.Name;
        }

19 View Source File : ExprTableFullName.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprTableFullName? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(this.DbSchema, other.DbSchema) && this.TableName.Equals(other.TableName);
        }

19 View Source File : Helpers.cs
License : MIT License
Project Creator : 0x1000000

public static UpdateDatareplacedysis replacedyzeUpdateData<TTable, replacedem>
        (
            IEnumerable<replacedem> data,
            TTable targetTable,
            DataMapping<TTable, replacedem> dataMapKeys,
            DataMapping<TTable, replacedem> dataMap,
            IndexDataMapping? extraDataMap,
            ExprTableAlias sourceTableAlias
        )
        {
            var records = data.TryToCheckLength(out var capacity)
                ? capacity > 0 ? new List<ExprValueRow>(capacity) : null
                : new List<ExprValueRow>();

            if (records == null)
            {
                throw new SqExpressException("Input data should not be empty");
            }

            DataMapSetter<TTable, replacedem>? setter = null;
            List<ExprColumnName>? keys = null;
            IReadOnlyList<ExprColumnName>? allTableColumns = null;
            IReadOnlyList<ExprColumnName>? totalColumns = null;

            foreach (var item in data)
            {
                setter ??= new DataMapSetter<TTable, replacedem>(targetTable, item);

                setter.Nexreplacedem(item, totalColumns?.Count);
                dataMapKeys(setter);

                keys ??= new List<ExprColumnName>(setter.Columns);

                keys.replacedertNotEmpty("There should be at least one key");

                dataMap(setter);

                totalColumns = allTableColumns ??= new List<ExprColumnName>(setter.Columns);

                if (extraDataMap != null)
                {
                    extraDataMap.Invoke(setter);
                    if (ReferenceEquals(totalColumns, allTableColumns))
                    {
                        totalColumns = new List<ExprColumnName>(setter.Columns);
                    }
                }

                setter.EnsureRecordLength();
                records.Add(new ExprValueRow(setter.Record.replacedertFatalNotNull(nameof(setter.Record))));
            }

            if (records.Count < 1)
            {
                throw new SqExpressException("Input data should not be empty");
            }

            keys = keys.replacedertFatalNotNull(nameof(keys));
            allTableColumns = allTableColumns.replacedertFatalNotNull(nameof(allTableColumns));
            totalColumns = totalColumns.replacedertFatalNotNull(nameof(allTableColumns));

            var exprValuesTable = new ExprDerivedTableValues(new ExprTableValueConstructor(records), sourceTableAlias, totalColumns);

            if (keys.Count >= allTableColumns.Count)
            {
                throw new SqExpressException("The number of keys exceeds the number of columns");
            }

            return new UpdateDatareplacedysis(keys, allTableColumns, exprValuesTable);
        }

19 View Source File : ExprTableName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprTableName) obj);
        }

19 View Source File : ExprAliasGuid.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprAliasGuid? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Id.Equals(other.Id);
        }

19 View Source File : TableRef.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(TableRef? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return string.Equals(this.Schema, other.Schema, StringComparison.InvariantCultureIgnoreCase) && string.Equals(this.Name, other.Name, StringComparison.InvariantCultureIgnoreCase);
        }

19 View Source File : SqlBuilderBase.cs
License : MIT License
Project Creator : 0x1000000

public bool VisitExprQuerySpecification(ExprQuerySpecification exprQuerySpecification, IExpr? parent)
        {
            this.Builder.Append("SELECT ");
            if (exprQuerySpecification.Distinct)
            {
                this.Builder.Append("DISTINCT ");
            }
            if (!ReferenceEquals(exprQuerySpecification.Top, null))
            {
                this.AppendSelectTop(exprQuerySpecification.Top, exprQuerySpecification);
            }

            this.AcceptListComaSeparated(exprQuerySpecification.SelectList, exprQuerySpecification);

            if (exprQuerySpecification.From != null)
            {
                this.Builder.Append(" FROM ");
                exprQuerySpecification.From.Accept(this, exprQuerySpecification);
            }

            if (exprQuerySpecification.Where != null)
            {
                this.Builder.Append(" WHERE ");
                exprQuerySpecification.Where.Accept(this, exprQuerySpecification);
            }

            if (exprQuerySpecification.GroupBy != null)
            {
                this.Builder.Append(" GROUP BY ");
                this.AcceptListComaSeparated(exprQuerySpecification.GroupBy, exprQuerySpecification);
            }

            if (!ReferenceEquals(exprQuerySpecification.Top, null) && !(parent is ExprSelect) && !(parent is ExprSelectOffsetFetch))
            {
                //For non T-SQL (PostgresSQL, My SQL)
                this.AppendSelectLimit(exprQuerySpecification.Top, exprQuerySpecification);
            }

            return true;
        }

19 View Source File : TableRef.cs
License : MIT License
Project Creator : 0x1000000

public int CompareTo(TableRef? other)
        {
            if (ReferenceEquals(this, other)) return 0;
            if (ReferenceEquals(null, other)) return 1;
            var schemaComparison = string.Compare(this.Schema, other.Schema, StringComparison.Ordinal);
            if (schemaComparison != 0) return schemaComparison;
            return string.Compare(this.Name, other.Name, StringComparison.Ordinal);
        }

19 View Source File : ExprColumn.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprColumn? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(this.Source, other.Source) && Equals(this.ColumnName, other.ColumnName);
        }

19 View Source File : TempTableData.cs
License : MIT License
Project Creator : 0x1000000

private static T? EnsureColumnType<T>(TempTableBuilderCtx arg) where T : TableColumn
        {
            if (ReferenceEquals(arg.PreviousType, null))
            {
                return null;
            }
            if (arg.PreviousType is T result)
            {
                if (arg.PrimaryKey && (result.ColumnMeta == null || !result.ColumnMeta.IsPrimaryKey))
                {
                    throw new SqExpressException($"\"{arg.ColumnName.Name}\" should be marked as primary key in meta");
                }
                if (!arg.PrimaryKey && result.ColumnMeta != null && result.ColumnMeta.IsPrimaryKey)
                {
                    throw new SqExpressException($"\"{arg.ColumnName.Name}\" should not be marked as primary key in meta");
                }
                return result;
            }

            throw new SqExpressException($"\"{typeof(T).Name}\" was expected");
        }

19 View Source File : MySqlBuilder.cs
License : MIT License
Project Creator : 0x1000000

protected override bool ForceParenthesesForQueryExpressionPart(IExprSubQuery subQuery)
        {
            return subQuery switch
            {
                ExprQuerySpecification specification => !ReferenceEquals(specification.Top, null),
                _ => true
            };

19 View Source File : SqlBuilderBase.cs
License : MIT License
Project Creator : 0x1000000

public bool VisitExprSelect(ExprSelect exprSelect, IExpr? parent)
        {
            exprSelect.SelectQuery.Accept(this, exprSelect);
            this.Builder.Append(" ORDER BY ");
            exprSelect.OrderBy.Accept(this, exprSelect);

            if (exprSelect.SelectQuery is ExprQuerySpecification specification)
            {
                if (!ReferenceEquals(specification.Top, null))
                {
                    this.AppendSelectLimit(specification.Top, exprSelect);
                }
            }

            return true;
        }

19 View Source File : ExprTableAlias.cs
License : MIT License
Project Creator : 0x1000000

public bool Equals(ExprTableAlias? other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return this.Alias.Equals(other.Alias);
        }

19 View Source File : ColumnRef.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ColumnRef) obj);
        }

19 View Source File : ExprDatabaseName.cs
License : MIT License
Project Creator : 0x1000000

public override bool Equals(object? obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((ExprDatabaseName) obj);
        }

See More Examples