Consider the following code:
public ActionResult GenericActionForSomething(string objectType)
{
switch (objectType)
{
case "Business":
// Do Something with object here, like save
_db.Create<Business>();
break;
}
return View();
}
How can I convert a string parameter to an object? For this example I need to convert the parameter "objectType" into an object of type "Business". Any ideas would be greatly appreciated.