Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

can i get a value from a Type?

$
0
0

i have a class which has a value

public class foo
{
   public string SomeValue => "999";
}

i only have the Type,is there a way to

public void SomeWork(Type type)
{
 var avariable = //get 999 from the Type
}

the value is fixed in the class, which will then be used to inherite from.

i am trying to not need to manually put the value in the method.

any suggestions appriciated.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>