예제 #1
0
        void ReadKeyData(SqlDataReader reader, Dictionary <Guid, IDictionary <XName, InstanceValue> > associatedInstanceKeys,
                         Dictionary <Guid, IDictionary <XName, InstanceValue> > completedInstanceKeys)
        {
            Exception exception = StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader);

            if (exception == null)
            {
                if (reader.IsDBNull(1))
                {
                    return;
                }

                do
                {
                    Guid key          = reader.GetGuid(1);
                    bool isAssociated = reader.GetBoolean(2);
                    InstanceEncodingOption encodingOption = (InstanceEncodingOption)reader.GetByte(3);
                    Dictionary <Guid, IDictionary <XName, InstanceValue> > destination = isAssociated ? associatedInstanceKeys : completedInstanceKeys;

                    if (!reader.IsDBNull(4))
                    {
                        destination[key] = SerializationUtilities.DeserializeKeyMetadata((byte[])reader.GetValue(4), encodingOption);
                    }
                    else
                    {
                        destination[key] = new Dictionary <XName, InstanceValue>();
                    }
                }while (reader.Read());
            }
        }
예제 #2
0
 private void ReadKeyData(SqlDataReader reader, Dictionary <Guid, IDictionary <XName, InstanceValue> > associatedInstanceKeys, Dictionary <Guid, IDictionary <XName, InstanceValue> > completedInstanceKeys)
 {
     if ((StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader) == null) && !reader.IsDBNull(1))
     {
         do
         {
             Guid guid    = reader.GetGuid(1);
             bool boolean = reader.GetBoolean(2);
             InstanceEncodingOption @byte = (InstanceEncodingOption)reader.GetByte(3);
             Dictionary <Guid, IDictionary <XName, InstanceValue> > dictionary = boolean ? associatedInstanceKeys : completedInstanceKeys;
             if (!reader.IsDBNull(4))
             {
                 dictionary[guid] = SerializationUtilities.DeserializeKeyMetadata((byte[])reader.GetValue(4), @byte);
             }
             else
             {
                 dictionary[guid] = new Dictionary <XName, InstanceValue>();
             }
         }while (reader.Read());
     }
 }