Example #1
0
 public void AddMultiIndexContainsQueryParam(byte[] indexId, MultiIndexContainsQueryParams multiIndexContainsQueryParam)
 {
     if (MultiIndexContainsQueryParamsMapping == null)
     {
         MultiIndexContainsQueryParamsMapping = new Dictionary <byte[], MultiIndexContainsQueryParams>(new ByteArrayEqualityComparer());
     }
     multiIndexContainsQueryParam.BaseQuery = this;
     MultiIndexContainsQueryParamsMapping.Add(indexId, multiIndexContainsQueryParam);
 }
Example #2
0
        internal MultiIndexContainsQueryParams GetMultiIndexContainsQueryParamForIndexId(byte[] indexId)
        {
            MultiIndexContainsQueryParams retVal;

            if ((MultiIndexContainsQueryParamsMapping == null) || !MultiIndexContainsQueryParamsMapping.TryGetValue(indexId, out retVal))
            {
                retVal = new MultiIndexContainsQueryParams(this);
            }
            return(retVal);
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //IndexItemList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexItem indexItem;
                IndexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    IndexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //MultiIndexContainsQueryParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                MultiIndexContainsQueryParamsMapping = new Dictionary <byte[], MultiIndexContainsQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                MultiIndexContainsQueryParams multiIndexContainsQueryParams;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        multiIndexContainsQueryParams = null;
                        if (reader.ReadBoolean())
                        {
                            multiIndexContainsQueryParams = new MultiIndexContainsQueryParams();
                            Serializer.Deserialize(reader.BaseStream, multiIndexContainsQueryParams);
                        }

                        MultiIndexContainsQueryParamsMapping.Add(indexId, multiIndexContainsQueryParams);
                    }
                }
            }

            //FullDataIdInfo
            if (reader.ReadBoolean())
            {
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            //Count
            Count = reader.ReadInt32();

            //IndexCondition
            if (reader.ReadBoolean())
            {
                IndexCondition = new IndexCondition();
                Serializer.Deserialize(reader.BaseStream, IndexCondition);
            }

            if (version >= 2)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }