Exemplo n.º 1
0
        /// <summary>
        /// Deserializa usando o CompactSerializer.
        /// </summary>
        /// <param name="reader">Representa o compact reader.</param>
        public void Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            var count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var parameter = new QueryParameter();
                parameter.Deserialize(reader);
                Add(parameter);
            }
        }
        /// <summary>
        /// Deserializa usando o CompactSerializer.
        /// </summary>
        /// <param name="reader">Representa o compact reader.</param>
        void Colosoft.Serialization.ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            var count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var parameter = new ReferenceParameterValue();
                ((Colosoft.Serialization.ICompactSerializable)parameter).Deserialize(reader);
                Add(parameter);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Desserializa o objeto.
        /// </summary>
        /// <param name="reader"></param>
        protected override void Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            int length = reader.ReadInt32();

            _values = new ConditionalTerm[length];
            for (int i = 0; i < length; i++)
            {
                if (reader.ReadBoolean())
                {
                    _values[i] = GetConditionalTerm(reader);
                }
            }
        }
Exemplo n.º 4
0
        void Colosoft.Serialization.ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            this.Expression = reader.ReadString();
            var count      = reader.ReadInt32();
            var parameters = new List <QueryParameter>(count);

            for (var i = 0; i < count; i++)
            {
                var parameter = new QueryParameter();
                ((Colosoft.Serialization.ICompactSerializable)parameter).Deserialize(reader);
                parameters.Add(parameter);
            }
            _parameters = parameters.ToArray();
            count       = reader.ReadInt32();
            var requiredFields = new List <RequiredField>(count);

            for (var i = 0; i < count; i++)
            {
                var field = new RequiredField();
                ((Colosoft.Serialization.ICompactSerializable)field).Deserialize(reader);
                requiredFields.Add(field);
            }
            _requiredFields = requiredFields.ToArray();
        }
Exemplo n.º 5
0
            /// <summary>
            /// Deserializa os dados para a instancia.
            /// </summary>
            /// <param name="reader"></param>
            void Colosoft.Serialization.ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
            {
                Name = reader.ReadString();
                var locale = reader.ReadString();

                if (!string.IsNullOrEmpty(locale))
                {
                    _locale = System.Globalization.CultureInfo.GetCultureInfo(locale);
                }
                var count = reader.ReadInt32();

                _fields = new List <Field>(count);
                for (var i = 0; i < count; i++)
                {
                    var field = new Field();
                    ((Colosoft.Serialization.ICompactSerializable)field).Deserialize(reader);
                    _fields.Add(field);
                }
            }
Exemplo n.º 6
0
        /// <summary>
        /// Deserializa usando o CompactSerializer.
        /// </summary>
        /// <param name="reader">Representa o compact reader.</param>
        public void Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            _name      = reader.ReadString();
            _direction = (ParameterDirection)reader.ReadInt32();
            var option = reader.ReadByte();

            if (option == 1)
            {
                _value = reader.ReadObject();
            }
            else if (option == 2)
            {
                var refParameter = new ReferenceParameter();
                ((Colosoft.Serialization.ICompactSerializable)refParameter).Deserialize(reader);
                _value = refParameter;
            }
            else if (option == 3)
            {
                var queryInfo = new QueryInfo();
                ((Colosoft.Serialization.ICompactSerializable)queryInfo).Deserialize(reader);
                _value = queryInfo;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Desserializa o objeto.
        /// </summary>
        /// <param name="reader"></param>
        void ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
        {
            _id = reader.ReadInt32();
            _isSelectDistinct       = reader.ReadBoolean();
            _ignoreRegisterUserInfo = reader.ReadBoolean();
            try
            {
                Enum.TryParse <QueryMethod>(reader.ReadString(), out _method);
            }
            catch (OutOfMemoryException)
            {
                throw;
            }
            _isolationLevel   = (System.Transactions.IsolationLevel)reader.ReadInt16();
            _commandTimeout   = reader.ReadInt32();
            _providerName     = reader.ReadString();
            _ignoreTypeSchema = reader.ReadBoolean();
            if (reader.ReadBoolean())
            {
                _storedProcedureProvider = reader.ReadString();
            }
            if (reader.ReadBoolean())
            {
                _projection = new Projection();
                ((ICompactSerializable)_projection).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                _executePredicate = new QueryExecutePredicate();
                ((ICompactSerializable)_executePredicate).Deserialize(reader);
            }
            var entitiesQueue = new Queue <EntityInfo>();

            while (reader.ReadBoolean())
            {
                var entity = new EntityInfo();
                ((ICompactSerializable)entity).Deserialize(reader);
                entitiesQueue.Enqueue(entity);
            }
            _entities = entitiesQueue.ToArray();
            var joinQueue = new Queue <JoinInfo>();

            while (reader.ReadBoolean())
            {
                var join = new JoinInfo();
                ((ICompactSerializable)join).Deserialize(reader);
                joinQueue.Enqueue(join);
            }
            _joins = joinQueue.ToArray();
            if (reader.ReadBoolean())
            {
                _whereClause = new ConditionalContainer();
                ((ICompactSerializable)_whereClause).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                _sort = new Sort();
                ((ICompactSerializable)_sort).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                _groupby = new GroupBy();
                ((ICompactSerializable)_groupby).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                _having = new ConditionalContainer();
                ((ICompactSerializable)_having).Deserialize(reader);
            }
            if (reader.ReadBoolean())
            {
                _takeParameters = new TakeParameters();
                ((ICompactSerializable)_takeParameters).Deserialize(reader);
            }
            var nestedQueries = new List <QueryInfo>();

            while (reader.ReadBoolean())
            {
                var nestedQuery = new QueryInfo();
                ((ICompactSerializable)nestedQuery).Deserialize(reader);
                nestedQueries.Add(nestedQuery);
            }
            _nestedQueries = nestedQueries.ToArray();
            if (_parameters == null)
            {
                _parameters = new QueryParameterCollection();
            }
            while (reader.ReadBoolean())
            {
                var parameter = new QueryParameter();
                parameter.Deserialize(reader);
                _parameters.Add(parameter);
            }
            if (reader.ReadBoolean())
            {
                _storedProcedureName = new StoredProcedureName();
                ((ICompactSerializable)_storedProcedureName).Deserialize(reader);
            }
            if (_unions == null)
            {
                _unions = new UnionInfoCollection();
            }
            while (reader.ReadBoolean())
            {
                var union = new UnionInfo();
                union.Deserialize(reader);
                _unions.Add(union);
            }
        }
Exemplo n.º 8
0
 void Colosoft.Serialization.ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
 {
     _name  = reader.ReadString();
     _index = reader.ReadInt32();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Desserializa o objeto
 /// </summary>
 /// <param name="reader"></param>
 void ICompactSerializable.Deserialize(Colosoft.Serialization.IO.CompactReader reader)
 {
     _take = reader.ReadInt32();
     _skip = reader.ReadInt32();
 }