User594242481 posted
Hi everyone,
I am trying to write some generic method which should get user setting from databse in right type with its value.
For now I have following method outline:
class SettingsManager
{
public static T GetValue<T>(string parameterName, object defaultValue)
{
// Gets the value from db according to parametrName
// Some code to get parametr value from db
Type t = typeof(T);
// ....
}
}
And I dont know how to create new type bysed on <T> and give it the value from db and return it :(
Thank you for your help.