jeudi 14 avril 2016

How to cast to type of object based on the object type?

I want to avoid using the specific type (forgort how I did it before)

var obj = new List<Category>();
obj = (List<Category>)EasyCache.Instance.Item(cacheKey)

Something like: obj = (obj.GetType()???)EasyCache.Instance.Item(cacheKey)





Aucun commentaire:

Enregistrer un commentaire