samedi 19 décembre 2015

WebApi2 Attribute Routing doesn't work unless controller classes are named in a specific manner

I was debugging an issue with attribute routing giving 404s for known-good routes. Well, known-good to me, but they weren't being picked up by the framework. I was grouping my controllers/models into logical units, e.g.:


So my "AuthController" is named MyApi.Auth.Controller instead of, for instance, MyApi.Auth.AuthController.

My routes were not being picked up until I renamed my controller, adding anything before it, e.g. zzController. This makes me think there's a bug in attribute routing, or am I missing something?

Aucun commentaire:

Enregistrer un commentaire