Redis Get HashSet into desired type not working with nullable type
<p>I have inserted my class value into redis via following method</p>

<pre><code> public static bool InsertHashItem(string key, object obj)
        {
            bool result = false;
            try
            {
                if (Muxer != null &amp;&amp; Muxer.IsConnected &amp;&amp; Muxer.GetDatabase() != null)
                {
                    IDatabase getDatabase = Muxer.GetDatabase();
                    getDatabase.HashSet(key, ToHashEntries(obj));
                    result = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex.Message, ex);
            }
            return result;
        }
</code></pre>

<p>My class looks like </p>

<pre><code>  public class TestType
    {
        public int telcoid { get; set; }
        public int parent_id { get; set; }
        public string checksum { get; set; }
        public string tag_registration_id { get; set; }
        public string market_id { get; set; }
        public double amount { get; set; }
        public string utid { get; set; }
        public int status { get; set; }

        public DateTime? dt { get; set; }

    }
</code></pre>

<p>Now to get that class i have written a method which is failing on nullable types</p>

<pre><code> public static T GetHashItem&lt;T&gt;(string key) where T : new()
        {
            T obj = default(T);

            try
            {
                if (Muxer != null &amp;&amp; Muxer.IsConnected &amp;&amp; Muxer.GetDatabase() != null)
                {
                    IDatabase getDatabase = Muxer.GetDatabase();
                    var hashkey = getDatabase.HashKeys(key);
                    if (hashkey != null &amp;&amp; hashkey.Count() &gt; 0)
                    {
                        var dic = hashkey.ToDictionary(k =&gt; k, k =&gt; getDatabase.HashGet(key, k));

                        obj = new T();
                        foreach (var prop in typeof(T).GetProperties())
                        {


                            prop.SetValue(obj, Convert.ChangeType(dic[prop.Name], prop.PropertyType));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex.Message, ex);
            }
            return obj;
        }
</code></pre>

<p>Please advice what correction i need in it</p>