Exemple #1
0
        public IRegistrationBuilder Named <TService>(string name)
        {
            #region Please modify the code to pass the test

            /*
             * Please support registration by both type and name.
             */
            Service = new TypedNameService(typeof(TService), name);
            return(this);

            #endregion
        }
        public IRegistrationBuilder Named <TService>(string name)
        {
            #region Please modify the code to pass the test

            /*
             * Please support registration by both type and name.
             */
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Service = new TypedNameService(typeof(TService), name);
            return(this);

            #endregion
        }
 public IRegistrationBuilder Named(string name, Type type)
 {
     Service = new TypedNameService(type, name);
     return(this);
 }
 public IRegistrationBuilder Named <TService>(string name)
 {
     Service = new TypedNameService(typeof(TService), name);
     return(this);
 }