public static async Task <HttpResponseMessage> RunHttp(
            [HttpTrigger(AuthorizationLevel.Function, "GET", Route = null)] HttpRequestMessage req, [Inject] ILog log,
            [Inject] IPsrsReportsService psrsService)
        {
            await psrsService.CreatePsrsSubmittedReports(DateTime.Now.Subtract(DateTime.Parse("2018-01-01")));

            return(req.CreateResponse(HttpStatusCode.NoContent));
        }
示例#2
0
        public async Task SetupDatabase()
        {
            var container = new Container(c => { c.AddRegistry <DAS.Data.Functions.Ioc.DefaultRegistry>(); });

            Mediator       = container.GetInstance <IMediator>();
            PsrsRepository = container.GetInstance <IPsrsRepository>();

            Log = new NLogLogger(typeof(StatisticsService), null);

            PsrsTestsRepository        = new PsrsTestsRepository(DataAcceptanceTests.Config.DatabaseConnectionString);
            PsrsExternalRepositoryMock = new Mock <IPsrsExternalRepository>();

            await PsrsTestsRepository.DeletePublicSectorReports();

            await PsrsTestsRepository.DeletePublicSectorSummary();

            PsrsReportsService = new PsrsReportsService(PsrsExternalRepositoryMock.Object, PsrsRepository);
        }
 public static async Task Run([TimerTrigger("%CronSchedule%")] TimerInfo myTimer, [Inject] ILog log,
                              [Inject] IPsrsReportsService psrsService)
 {
     await psrsService.CreatePsrsReportSubmissionsSummary();
 }