Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Dictionary<string, T> FetchDictionary<T>() where T:IConvertible
- {
- if (typeof(T) == typeof(int))
- {
- return IntsDictionary.ToDictionary(x=> x.Key,x=> (T)Convert.ChangeType(x.Value,typeof(T)));
- }
- if (typeof(T) == typeof(string))
- {
- return StringsDictionary.ToDictionary(x => x.Key, x => (T)Convert.ChangeType(x.Value, typeof(T)));
- }
- return DoublesDictionary.ToDictionary(x => x.Key, x => (T)Convert.ChangeType(x.Value, typeof(T)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement