(I had this sitting in draft form for years now, and I just dug it up. Most of it is pretty obsolete, with .net core and all, but I’ll just leave this here.)
In a previous post, I discussed a method for using abstract classes in ASP.NET MVC 4.0. With it, I was able to clean up and hide the details of implementation from much of my code. I assumed that it would be relatively simple to do the equivalent in Web API, but I found that the task to be quite different.
The equivalent functionality requires use of asynchronous programming, code generation, and some complex processing for handling things like IEnumerable
. I also found some race conditions that needed to be addressed.