Пример #1
0
        public object ToObject(DbValue item, IMember member)
        {
            var precision = (TimePrecision)(member.Precision ?? 3);

            switch (precision)
            {
            case TimePrecision.Second: return(TimeSpan.FromSeconds(item.ToInt()));

            default: return(TimeSpan.FromMilliseconds(item.ToInt()));
            }
        }
Пример #2
0
        public object ToObject(DbValue item, IMember member)
        {
            // Parse strings to allow graceful migration to integers

            if (item.Kind == DbValueType.S)
            {
                return(Enum.Parse(member.Type, item.ToString()));
            }

            return(Enum.ToObject(member.Type, item.ToInt()));
        }
Пример #3
0
 public object ToObject(DbValue item, IMember member) => item.ToInt();
Пример #4
0
 public object ToObject(DbValue item, IMember member)
 {
     return(item.ToInt());
 }