Open ryepup opened 9 years ago
I use IModelBinder to supply default arguments to my controller actions for things like "current logged in user", so my controller action looks like:
IModelBinder
public SaveResult Save(SaveRequest req, IUser currentUser){ return DB.save(res, currentUser); };
with the model binder filling in the correct value for currentUser.
currentUser
The JS proxy generated for Save should ignore the IUser parameter, since it will be bound automatically by WebApi.
Save
IUser
http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api
The Web API help pages has some logic for ignoring this parameter, I'm not sure if that's open source enough to use as an example.
Hi @ryepup can you please provide more information and maybe an example?
I use
IModelBinder
to supply default arguments to my controller actions for things like "current logged in user", so my controller action looks like:with the model binder filling in the correct value for
currentUser
.The JS proxy generated for
Save
should ignore theIUser
parameter, since it will be bound automatically by WebApi.http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api