// This method gets called by the runtime. Use this method to add services to the container.
        public IServiceProvider ConfigureServices(Microsoft.Extensions.DependencyInjection.IServiceCollection services)
        {
            services.AddAspNetCoreSystemServices();
            services.AddMvc()
            .AddJsonOptions(
                s => SF.Core.Serialization.Newtonsoft.JsonSerializer.ApplySetting(
                    s.SerializerSettings,
                    new SF.Core.Serialization.JsonSetting
            {
                IgnoreDefaultValue = true,
                WithType           = false
            })
                );

            var ins = HygouApp.Setup(SF.Core.Hosting.EnvironmentType.Production, services)
                      .With(sc =>
                            sc.AddAspNetCoreSupport()
                            .AddAccessTokenHandler(
                                "HYGOU",
                                "123456",
                                null,
                                null
                                )
                            )
                      .OnEnvType(
                t => t != EnvironmentType.Utils,
                sc =>
            {
                sc.AddNetworkService();
                sc.AddAspNetCoreServiceInterface();
                sc.AddIdentityServer4Support();
                var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("system"));
                sc.AddSingleton <ISigningCredentialStore>(
                    new DefaultSigningCredentialsStore(
                        new Microsoft.IdentityModel.Tokens.SigningCredentials(
                            key,
                            SecurityAlgorithms.HmacSha256
                            )
                        ));
            }
                )
                      .Build();

            return(ins.ServiceProvider);
        }