我以“今天”为支点从数据库中生成报告。
例如
public class Function {
public static Func<IServiceProvider> ConfigureServices = () => {
var serviceCollection = new ServiceCollection();
serviceCollection.AddHttpClient("client", client =>
{
client.BaseAddress = new Uri("someurl");
});
serviceCollection.AddTransient<ITestClass, TestClass>();
return serviceCollection.BuildServiceProvider();
};
static IServiceProvider services;
static Function() {
services = ConfigureServices();
}
public async Task Handler(ILambdaContext context) {
ITestClass test = services.GetService<ITestClass>();
await test.RunAsync();
//...
}
}
但是某些有30天的月份,因此我无法获得31日的报告。
欢迎任何解决方案 谢谢