Member
5 Points
167 Posts
Aug 01, 2020 10:39 PM|fazioliamboina|LINK
i want a function to return an object casted to the type that a caller specifies
Definition
public T GetCache<T>() { return (T)Convert.ChangeType(CachedModel, typeof(T)); }
Usage (as you see, it does not get casted, because it does not have any property suggestions)
Member
5 Points
167 Posts
C# function | return an objected with its type, so i dont have to cast it.
Aug 01, 2020 10:39 PM|fazioliamboina|LINK
i want a function to return an object casted to the type that a caller specifies
Definition
Usage (as you see, it does not get casted, because it does not have any property suggestions)