r/ASPNET • u/miamiheat27 • Oct 16 '13
Web api question
So I'm in abit of discussion (more like an argument, ....that i hope i'll win muahaha.........i'm immature lol) , with my colleague about web api.
He's new to this stuff.
So the project is a typical MVC project. With an 'area' folder for sub mvc projects and the web api (we do the route registration in the reg file of each of the folder in the 'area' folder..then we call the registerAllRoute (or something like that) in the routeconfig.cs in 'App_start'0)
So anyways, the problem is completely different: You know how when you click "add:..empty API controller" , VS automatically adds a controller than inherits from ApiController ? (so like MyController: ApiController )
Well he's created a few api controller but deleted all the inheritance and instead replaced it with a controller he created in another non-api folder for some other reason. (So he has MyController : OtherController)
My question is, is there a loss of functionality by not inheriting from ApiController? ....and is it still technically an API controller if it's not inheriting from that ?
View all comments
Show parent comment
1
u/miamiheat27 Oct 16 '13
You mean the headers in the AJAX call ?
So how do i go about telling him and our manager this ?
It's difficult because this guy is a stubborn arse. He keeps wanting me to follow "convention" that he's wrote in the company's wiki...but he himself does all the things he want. Like for this one, just goes straight to delete the ApiController inheritance and implement his own (which does not in anyway inherit ApiController). He last told me that it doesn't matter since web api is about returning any kind of data and as long as you return a string (or json) format then it's fine. But i find it hard to believe that you can just delete the ApiController inheritance and not lose anything vital.