0
|
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 }
|