Esempio n. 1
0
        public override void RegisterDependencies(IMutableDependencyResolver resolver)
        {
            var proxy = new DependencyResolverProxy(resolver);

            base.RegisterDependencies(proxy);
            AssertContainsTypes(proxy,
                                typeof(RouterConfig),
                                typeof(IRouter),
                                typeof(IObjectStateStore));
        }
Esempio n. 2
0
        private void AssertContainsTypes(DependencyResolverProxy proxy, params Type[] types)
        {
            var missingTypes = new List <Type>(types.Length);

            missingTypes.AddRange(types.Where(t => !proxy.RegisteredServices.Contains(t)));
            if (missingTypes.Count <= 0)
            {
                return;
            }
            var missingTypesStr = String.Join(", ", missingTypes.Select(t => t.ToString()).OrderBy(s => s));

            throw new InvalidOperationException("Application is missing required registrations: " + missingTypesStr);
        }