Exemplo n.º 1
0
 public ResponseTypeTest()
 {
     testService = ApiServiceCreater.CreateObject <ITestService>("https://docs.microsoft.com/");
     //
     //TODO:  在此处添加构造函数逻辑
     //
 }
Exemplo n.º 2
0
 public App()
 {
     HttpClientSetting.DefaultSetting.SetHeader("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36 Edg/89.0.774.75");
     //var service = ApiServiceCreater.CreateObject<IMicrosoftService>("https://docs.microsoft.com");
     //buider.RegisterInstance(service);
     buider.Register(new System.Func <IComponentContext, IMicrosoftService>((e) =>
     {
         //return new MicrosoftService("https://docs.microsoft.com/");
         return(ApiServiceCreater.CreateObject <IMicrosoftService>("https://docs.microsoft.com/"));
     }));
     Container = buider.Build();
 }