This question is locked. New answers and comments are not allowed.
I have created a custom Membership provider for entity framework for a User model. In the provider, I instantiate a new UsersController (uc = new UsersController() )
I've tried calling both uc.Put([some id], user) and uc.Post(user) and neither are working. The Post comes to the OpenAccessBaseApiController and does its work as expected. It successfully posts a new object to the DB. When it tries to call CreateResponse it goes to the concrete UsersController method CreateResponse. The problem is here. In this method, the Request (which is stored in ApiController) is null, so when it says Request.CreateResponse(httpStatusCode, entityToEmbed) it throws an exception.
When I call the api service from Postman as a GET, it works fine (and the Request property is populated and not null). I can't seem to find out why Request isn't getting populated for Post and PUT. Any help is greatly appreciated.
I've tried calling both uc.Put([some id], user) and uc.Post(user) and neither are working. The Post comes to the OpenAccessBaseApiController and does its work as expected. It successfully posts a new object to the DB. When it tries to call CreateResponse it goes to the concrete UsersController method CreateResponse. The problem is here. In this method, the Request (which is stored in ApiController) is null, so when it says Request.CreateResponse(httpStatusCode, entityToEmbed) it throws an exception.
When I call the api service from Postman as a GET, it works fine (and the Request property is populated and not null). I can't seem to find out why Request isn't getting populated for Post and PUT. Any help is greatly appreciated.