Deserialize() static private method

static private Deserialize ( BinaryReader reader ) : SqlExpression
reader System.IO.BinaryReader
return SqlExpression
Exemplo n.º 1
0
            public override SqlQueryExpression Deserialize(BinaryReader reader)
            {
                var selectColumns = DeserializeSelectColumns(reader);

                var queryExp = new SqlQueryExpression(selectColumns);

                var isDistinct = reader.ReadByte() == 1;

                queryExp.Distinct = isDistinct;

                var hasFrom = reader.ReadByte() == 1;

                if (hasFrom)
                {
                    queryExp.FromClause = FromClause.Deserialize(reader);
                }

                var hasWhere = reader.ReadByte() == 1;

                if (hasWhere)
                {
                    queryExp.WhereExpression = SqlExpression.Deserialize(reader);
                }

                var hasGroupMax = reader.ReadByte() == 1;

                if (hasGroupMax)
                {
                    queryExp.GroupMax = ObjectName.Deserialize(reader);
                }

                var hasHaving = reader.ReadByte() == 1;

                if (hasHaving)
                {
                    queryExp.HavingExpression = SqlExpression.Deserialize(reader);
                }

                return(queryExp);
            }