Exemplo n.º 1
0
        /// -------------------------------------------------------------------------------------------------
        /// <summary>
        /// Removes the type from DI.
        /// </summary>
        /// <param name="service">
        /// The service.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// -------------------------------------------------------------------------------------------------
        public static void Remove(Type service, string name = null)
        {
            IBindingInfo existingBinding = Resolve(service, name);

            if (existingBinding != null)
            {
                existingBinding.ReleaseInstance();
                Bindings.Remove(service, existingBinding);
            }
        }