store course settings in their own file

This commit is contained in:
2023-09-22 13:05:49 -06:00
parent fa792f1f23
commit edc71b2546
2 changed files with 18 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
using YamlDotNet.Serialization;
namespace LocalModels;
public record LocalCourse
@@ -18,6 +20,13 @@ public record LocalCourseSettings
public SimpleTimeOnly DefaultDueTime { get; init; } = new SimpleTimeOnly();
public IEnumerable<AssignmentTemplate> AssignmentTemplates { get; init; } =
Enumerable.Empty<AssignmentTemplate>();
public string ToYaml()
{
var serializer = new SerializerBuilder().DisableAliases().Build();
var yaml = serializer.Serialize(this);
return yaml;
}
}
public record SimpleTimeOnly