RestCode / WebApiProxy

MIT License
199 stars 91 forks source link

js proxy does not ignore parameters covered by an `IModelBinder` #36

Open ryepup opened 9 years ago

ryepup commented 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:

public SaveResult Save(SaveRequest req, IUser currentUser){
  return DB.save(res, currentUser);
};

with the model binder filling in the correct value for currentUser.

The JS proxy generated for Save should ignore the IUser 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

ryepup commented 9 years ago

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.

faniereynders commented 8 years ago

Hi @ryepup can you please provide more information and maybe an example?