I'm trying to use WCF REST Services and Unity (Enterprise Library 5), but can not find examples of how to implement the resolution of the services using Unity. I would like to call the registration of all interfaces and implementations for resolution in global.asax.
I'm using the following class to register the container:
public class DependencyResolver
{
public static IUnityContainer Container { get; private set; }\
static DependencyResolver()
{
Container = new UnityContainer()
.AddNewExtension<EnterpriseLibraryCoreExtension>()
.RegisterType<IServiceDAO, ServiceDAO>()
.RegisterType<IServiceBO, ServiceBO>()
.RegisterType<IService, Service>();
}
}
I searched but could not find enough examples, someone would have a code example with this solution applied?
I found some examples, like How do I pass values to the constructor on my wcf service? but I want the same context for all services. I want something like this http://entlibex.codeplex.com/wikipage?title=Unity%20Service%20Behavior&referringTitle=Documentation but in my case I don't have a svc file.
Thank you.