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())); } }
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())); }
public object ToObject(DbValue item, IMember member) => item.ToInt();
public object ToObject(DbValue item, IMember member) { return(item.ToInt()); }