the problem: I need to know the datatype of class models which I can use as a variable in a normal function.
the attempt: I used object as a variable to pass any class Model
public object JsonToModel(string JsonModel, object model)
{
object getModel = JsonConvert.DeserializeObject<model>(JsonModel);
return getModel;
}
the result: problem result
the usage: problem usage
string UserJson = HttpContext.Session.GetString("SignedInUser");
User UserObj = utilities.JsonToModel(UserJson);
Note: User is a class Model
if object makes the problem as it can't stand to use class models as a variable. which data type can do this?