I'm a huge fan of coding against interfaces. In the WCF world, this highly emphasized on every service. However, I'm getting deeper into ASP.NET Web Api, as an extension of MVC 4, I was curious to see if there was some typical reasoning to have your controller implementations inherit from an interface.
I know the default settings for ASP.NET Web Api look something like this
public class TestsController : ApiController
{
public IEnumerable<string> Get()
{
var testValues = new List<string>
{
"Something",
"Welcome to the top of the world"
};
return testValues;
}
}
As opposed to this WITH a cooresponding interface (or interfaces).
public class TestsController : ApiController, ITestsController
{
public IEnumerable<string> Get()
{
var testValues = new List<string>
{
"Something",
"Welcome to the top of the world"
};
return testValues;
}
}