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.GetInt16(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.GetInt16(sourceObject, sourceIndex))); } }
sealed class EI16 <E> : MB <E> { public override E From(IMapDataSource s, object o, int i) { return((E)(object)s.GetInt16(o, i)); }
sealed class NEI16 <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.GetInt16(o, i)); }
sealed class I16 : MB <Int16> { public override Int16 From(IMapDataSource s, object o, int i) { return(s.GetInt16(o, i)); }