For simplicity's sake, lets say I have the following Abstract Base Controller Class:
public abstract class RESTController : Controller
{
public abstract JsonResult List();
public abstract JsonResult Get(Guid id);
public abstract JsonResult Create(object obj);
public abstract JsonResult Update(object obj);
public abstract JsonResult Delete(Guid Id);
}
For the Create & Update methods, I not only want to override the Method, but also the type of the parameter.
Typically I would use generics like so:
public abstract JsonResult Create<T>(T obj);
However this is an MVC action, and there is no way to specify type parameters.
What are my options? If I leave it as (object obj)
will the MVC model binder work correctly?
var model = obj as MyViewModel;
This isn't very clean in any case. Any help would be appreciated.