Example #1
0
 public Mapping(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     if (SerializerHelper.UseFastSerialization)
     {
         using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
         {
             _PrimaryColumn         = (Column)ScriptBase.Lookups[reader.ReadString()];
             _AssociatedColumnId    = reader.ReadString();
             _AssociatedParameterId = reader.ReadString();
         }
     }
     else
     {
         if (SerializationVersionExists)
         {
             try
             {
             }
             catch (SerializationException)
             {
                 // ignore
                 SerializationVersionExists = false;
             }
         }
         _PrimaryColumn       = (Column)serializationInfo.GetValue("PrimaryColumn", typeof(Column));
         _AssociatedColumn    = (Column)serializationInfo.GetValue("AssociatedColumn", typeof(Column));
         _AssociatedParameter = (StoredProcedure.Parameter)serializationInfo.GetValue("AssociatedParameter", typeof(StoredProcedure.Parameter));
     }
 }
Example #2
0
 public Mapping FindMappingByAssociatedParameter(StoredProcedure.Parameter associatedParameter)
 {
     foreach (Mapping mapping in Mappings)
     {
         if (mapping.AssociatedParameter == associatedParameter)
         {
             return(mapping);
         }
     }
     return(null);
 }
Example #3
0
 public Mapping(Column primaryColumn, Column associatedColumn, StoredProcedure.Parameter associatedParameter)
 {
     PrimaryColumn       = primaryColumn;
     AssociatedColumn    = associatedColumn;
     AssociatedParameter = associatedParameter;
 }
Example #4
0
 public Mapping(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     if (SerializerHelper.UseFastSerialization)
     {
         using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
         {
             _PrimaryColumn = (Column)ScriptBase.Lookups[reader.ReadString()];
             _AssociatedColumnId = reader.ReadString();
             _AssociatedParameterId = reader.ReadString();
         }
     }
     else
     {
         if (SerializationVersionExists)
         {
             try
             {
             }
             catch (SerializationException)
             {
                 // ignore
                 SerializationVersionExists = false;
             }
         }
         _PrimaryColumn = (Column)serializationInfo.GetValue("PrimaryColumn", typeof(Column));
         _AssociatedColumn = (Column)serializationInfo.GetValue("AssociatedColumn", typeof(Column));
         _AssociatedParameter = (StoredProcedure.Parameter)serializationInfo.GetValue("AssociatedParameter", typeof(StoredProcedure.Parameter));
     }
 }