During this series of posts I’m going to share with you how I work with WebApi. I’m going to share the steps with you so you understand exactly what is going on and the choices made. There of course is a GitHub repo you can folk and use in your own projects.
Being a consultant I have to create REST API’s (or as I like to say ‘RESTish API’s’*) a lot, I’m going to show you how I do it. When you create your WebApi project your first instinct might be to select the WebApi project template, I would resist doing it like that.
Not because there is anything wrong with using the templates, because there ins’t I’ve used both the WebApi and MVC templates as learning tools as well as for quick hacks. That said that’s what you should use them for – here are my reasons for saying that:
- So much of the config is done for you that it can be difficult to understand what’s going on, what if you need to change the config or had a deployment issue would you be confident in making changes?
- So many extra packages are added that you probably don’t need.
- It’s not Owin backed.