コード例 #1
0
        public static void GetTimeResultsAsJson(sc2dsstatsContext context, ILogger logger)
        {
            var replays = ReplayFilter.DefaultFilter(context);

            var results = replays
                          .Include(i => i.Dsplayers)
                          .Select(s => UploadService.GetTimeResultValues(s)).ToList().SelectMany(s => s).ToList();

            logger.LogInformation($"Got results: {results.Count} - serializing ...");
            File.WriteAllText("/data/results.json", JsonSerializer.Serialize(results, new JsonSerializerOptions()
            {
                WriteIndented = false
            }));
        }