Beispiel #1
0
            public void Map(
                IMapDataSource source, object sourceObject, int sourceIndex,
                IMapDataDestination dest, object destObject, int destIndex)
            {
                if (source.IsNull(sourceObject, sourceIndex))
                {
                    dest.SetNull(destObject, destIndex);
                }
                else
                {
                    var setter = MapSetData <T> .I;
                    var getter = MapGetData <T> .I;

                    setter.To(dest, destObject, destIndex,
                              getter.From(source, sourceObject, sourceIndex));
                }
            }
Beispiel #2
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetDecimal(destinationObject, destinationIndex, 0);
     }
     else
     {
         destination.SetDecimal(destinationObject, destinationIndex, Convert.ToDecimal(source.GetByte(sourceObject, sourceIndex)));
     }
 }
Beispiel #3
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetFloat(destinationObject, destinationIndex, 0);
     }
     else
     {
         destination.SetFloat(destinationObject, destinationIndex, Convert.ToSingle(source.GetString(sourceObject, sourceIndex)));
     }
 }
Beispiel #4
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetString(destinationObject, destinationIndex, null);
     }
     else
     {
         destination.SetString(destinationObject, destinationIndex, source.GetString(sourceObject, sourceIndex));
     }
 }
Beispiel #5
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetDateTime(destinationObject, destinationIndex, DateTime.MinValue);
     }
     else
     {
         destination.SetDateTime(destinationObject, destinationIndex, Convert.ToDateTime(source.GetString(sourceObject, sourceIndex)));
     }
 }
Beispiel #6
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetNullableInt64(destinationObject, destinationIndex, null);
     }
     else
     {
         destination.SetNullableInt64(destinationObject, destinationIndex, Convert.ToInt64(source.GetFloat(sourceObject, sourceIndex)));
     }
 }
Beispiel #7
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetBoolean(destinationObject, destinationIndex, false);
     }
     else
     {
         destination.SetBoolean(destinationObject, destinationIndex, Convert.ToBoolean(source.GetFloat(sourceObject, sourceIndex)));
     }
 }
Beispiel #8
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetNullableDateTime(destinationObject, destinationIndex, null);
     }
     else
     {
         destination.SetNullableDateTime(destinationObject, destinationIndex, Convert.ToDateTime(source.GetBoolean(sourceObject, sourceIndex)));
     }
 }
Beispiel #9
0
 public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex)
 {
     if(source.IsNull(sourceObject, sourceIndex))
     {
         destination.SetChar(destinationObject, destinationIndex, '\0');
     }
     else
     {
         destination.SetChar(destinationObject, destinationIndex, Convert.ToChar(source.GetNullableInt32(sourceObject, sourceIndex)));
     }
 }