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, Convert.ToString(source.GetInt32(sourceObject, sourceIndex))); } }
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.GetInt32(sourceObject, sourceIndex))); } }
sealed class EI32 <E> : MB <E> { public override E From(IMapDataSource s, object o, int i) { return((E)(object)s.GetInt32(o, i)); }
sealed class NEI32 <E> : MB <E?> where E : struct { public override E?From(IMapDataSource s, object o, int i) { return /*s.IsNull(o, i) ? (E?)null :*/ ((E)(object)s.GetInt32(o, i)); }
sealed class I32 : MB <Int32> { public override Int32 From(IMapDataSource s, object o, int i) { return(s.GetInt32(o, i)); }