Casting issue visual studio generic type

I am using generic input parameter for Grasshopper input which is by default Gh_objectwrapper.

How can I cast retrieved input to my type which is I. E. called UniaxialMaterial?

When I try to write:
UniaxialMaterial mat = (UniaxialMaterial) uniaxial.

This casting produces an error that says it cannot convert gh_objectwrapper to UniaxialMaterial.

Have you tried accessing the Value property? Like so:

 UniaxialMaterial mat = (UniaxialMaterial) uniaxial.Value

This is just a guess from me, due to the fact that a wrapper “wraps” the value, which then is expected to reside inside the wrapper.

// Rolf

Thank you Ril, issue is solved.