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))); } }
public override void Map(IMapDataSource source, object sourceObject, int sourceIndex, IMapDataDestination destination, object destinationObject, int destinationIndex) { if(source.IsNull(sourceObject, sourceIndex)) { destination.SetNullableFloat(destinationObject, destinationIndex, null); } else { destination.SetNullableFloat(destinationObject, destinationIndex, Convert.ToSingle(source.GetByte(sourceObject, sourceIndex))); } }
sealed class EU8 <E> : MB <E> { public override E From(IMapDataSource s, object o, int i) { return((E)(object)s.GetByte(o, i)); }
sealed class NEU8 <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.GetByte(o, i)); }
sealed class U8 : MB <Byte> { public override Byte From(IMapDataSource s, object o, int i) { return(s.GetByte(o, i)); }