Subscribe to this list via RSS Blog posts tagged in ASP.NET Web API

Is HTML a valid media-type for building web sites with RESTful API ?

Posted by on in Development

This is the question I’ve been asking myself while confronted to a problem of building a web site and RESTful API at the same time. I’ve been told that I can’t build one and have both. Why ? HTML is just another media-type but what is generally used when building web sites is the capacity of templated view generation which is much more then simple HTML resource representation. And yes, I know, the ambiguity is even more emphasized when we try to chose a right framework for the task at hand. In short, the guideline is; if you want HTML based web site then use ASP.NET MVC and for JSON/XML support use rather ASP.NET Web API or another framework like Nancy (I’m speaking here for the .NET world). Well, I don’t want make my choice based on that criteria. Let’s go deeper to see what options we have.

Continue reading

Web Api (beta) and Castle.Windsor …without IDependencyResolver ?

Posted by on in Development

I’ve been reading through several blog post about how people configure DI support in the new ASP.NET Web Api. For example you can read about it here :

What stands out is that every implementation relays on System.Web.Http.Services.IDependencyResolver interface which is similar to the one introduced in the ASP.NET MVC 3 and which lives in the System.Web.Mvc namespace to avoid confusion. Let’s look at it’s implementation details :

public interface IDependencyResolver
	        object GetService(System.Type serviceType);
	        IEnumerable<object> GetServices(System.Type serviceType);
Continue reading