I am trying to use Unity as a resolver for creating my Breeze Web API controllers. Using breakpoints, it seems that the constructor for my AHSEFContextProvider is only being called one time. Breeze requires a new instance each time otherwise the SaveChanges() method doesn't work properly. I'm new to Unity but I thought using the TransientLifetimeManager (which I believe is the default anyway) would cause a new instance to be created each time. Below is the UnityConfig code which is being called from the Global.asax Application_Start. Any ideas on where I'm going wrong?
var container = new UnityContainer();
container.RegisterType<AHSEFContextProvider<TaskDbContext>>(new TransientLifetimeManager(), new InjectionConstructor("ConnectionStringName"));
container.RegisterType<TaskController>(new TransientLifetimeManager(), new InjectionConstructor(container.Resolve<AHSEFContextProvider<TaskDbContext>>()));
GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(container);