コード例 #1
0
        private void RegisterRequest <T>() where T : SynologyRequest
        {
            Logger.LogDebug($"Registering Request {typeof(T).Name}");

            var builder = new ContainerBuilder();
            var apiName = SynologyRequest.GetApiName <T>();

            if (!string.IsNullOrEmpty(apiName))
            {
                builder.RegisterType <T>().Named <SynologyRequest>(apiName).Named <T>(apiName).AsSelf().As <SynologyRequest>();
            }
            else
            {
                builder.RegisterType <T>().AsSelf().As <SynologyRequest>();
            }

            builder.Update(_container);
        }