Esempio n. 1
0
        private static List <Error> ValidateExercises(TrackConfigObjectTree trackConfigObjectTree)
        {
            var errors = trackConfigObjectTree.Exercises.Concept.Select(ex => ValidateExercise(ex))
                         .Where(exo => !string.IsNullOrWhiteSpace(exo))
                         .Select(exo => new Error(ErrorSource.Exercise, Severity.Error, exo))
                         .ToList();

            return(errors);
        }
Esempio n. 2
0
        public string ToString(TrackConfigObjectTree trackConfigObjectTree)
        {
            var options = new JsonSerializerOptions
            {
                PropertyNameCaseInsensitive = true,
                WriteIndented = true,
            };

            options.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));
            return(JsonSerializer.Serialize(trackConfigObjectTree, options));
        }