Exemple #1
0
        public static ItemInfo MapRunInfo(this ItemInfoDto itemInfoDto)
        {
            var run = new ItemInfo
            {
                Guid     = itemInfoDto.Guid,
                Start    = itemInfoDto.Start,
                Finish   = itemInfoDto.Finish,
                FileName = LocationsProvider.GetRunFileName(itemInfoDto.Guid)
            };

            return(run);
        }
Exemple #2
0
        public static void Save(this Run run, string path)
        {
            var fileName = LocationsProvider.GetRunFileName(run.RunInfo.Guid);

            run.RunInfo.FileName = fileName;
            path.Create();
            var fullRunPath = Path.Combine(path, fileName);

            using (var file = File.CreateText(fullRunPath))
            {
                var serializer = new JsonSerializer();
                serializer.Serialize(file, run);
            }
        }