comparison Source/Mapping/MemberMappers/TimeSpanBigIntMapper.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.IO;
3 using System.Runtime.Serialization.Formatters.Binary;
4
5 namespace BLToolkit.Mapping.MemberMappers
6 {
7 public class TimeSpanBigIntMapper : MemberMapper
8 {
9 public override void SetValue(object o, object value)
10 {
11 if (value != null) this.MemberAccessor.SetValue(o, new TimeSpan((long)value));
12 }
13
14 public override object GetValue(object o)
15 {
16 var val = this.MemberAccessor.GetValue(o);
17 if (val != null)
18 return ((TimeSpan) val).Ticks;
19 return null;
20 }
21 }
22 }