注释grpc demo
This commit is contained in:
parent
10b57594ac
commit
e49d007908
@ -175,13 +175,13 @@ app.MapControllers();
|
||||
using (var serviceScope = app.Services.CreateScope())
|
||||
{
|
||||
var services = serviceScope.ServiceProvider;
|
||||
|
||||
|
||||
// get the IpPolicyStore instance
|
||||
var ipPolicyStore = services.GetRequiredService<IIpPolicyStore>();
|
||||
|
||||
// seed IP data from appsettings
|
||||
ipPolicyStore.SeedAsync().GetAwaiter().GetResult();
|
||||
|
||||
|
||||
var optionsAccessor = services.GetRequiredService<IOptions<IpRateLimitOptions>>();
|
||||
var ipRateLimitPolicyService = services.GetRequiredService<IIpRateLimitPolicyService>();
|
||||
var ipRateLimitPolicies = ipRateLimitPolicyService.Queryable()
|
||||
@ -192,11 +192,11 @@ using (var serviceScope = app.Services.CreateScope())
|
||||
pol.IpRules.AddRange(ipRateLimitPolicies.Adapt<List<IpRateLimitPolicy>>());
|
||||
await ipPolicyStore.SetAsync(optionsAccessor.Value.IpPolicyPrefix, pol);
|
||||
|
||||
var greeterClient = services.GetRequiredService<Greeter.GreeterClient>();
|
||||
var helloReply = await greeterClient.SayHelloAsync(new HelloRequest
|
||||
{
|
||||
Name = "gree"
|
||||
});
|
||||
// var greeterClient = services.GetRequiredService<Greeter.GreeterClient>();
|
||||
// var helloReply = await greeterClient.SayHelloAsync(new HelloRequest
|
||||
// {
|
||||
// Name = "gree"
|
||||
// });
|
||||
// Console.WriteLine(helloReply);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user