I have two questions. I installed Unity and Unity MVC packages to start investigating it. I got some simple controller constructor injection working by registering some types, so it's going well. I notice that it's starting before even global.asax is hit due to:
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(example.org.UnityMvcActivator), nameof(example.org.UnityMvcActivator.Start))]
Question 1: What is even the name for this syntax? Some kind of in-line assembly reference that attaches a type/method here to elsewhere? I've never seen this before.
Question 2: The UnityMvcActivator has Start() and Shutdown() methods corresponding to the [assembly] lines above, the latter of which just calls dispose on the container. The central element of Start() is calling:
DependencyResolver.SetResolver(new UnityDependencyResolver(UnityConfig.Container));
Is there a compelling reason this UnityMvcActivator exists, like the dispose(), or maybe it needs to start as early as it does OR is it just boilerplate scaffolding to get me started, and I can just as well put that SetResolver() line into my global.asax and then remove this class?