public static Clocks.Server.ClockSettings AsSettings(this ClockSettings me) =>
        me == null ? throw new ArgumentNullException(nameof(me)) :
        new Clocks.Server.ClockSettings
        {
            DurationHours = me.DurationHours,

            ExpectedResumeTime = me.ExpectedResumeTime.AsTimeSpanOrNull(),
            IsRealTime         = me.Mode == "1",
            IsRunning          = me.IsRunning,
            Message            = new ClockMessage {
                DefaultText = me.Message
            },
            OverriddenElapsedTime  = me.OverriddenElapsedTime.AsTimeSpanOrNull(),
            PauseReason            = (PauseReason)(int.Parse(me.PauseReason, CultureInfo.CurrentCulture)),
            PauseTime              = me.PauseTime.AsTimeSpanOrNull(),
            ShouldRestart          = me.ShouldRestart,
            ShowRealTimeWhenPaused = me.ShowRealTimeWhenPaused,
            Speed        = me.Speed,
            StartTime    = me.StartTime.AsTimeSpanOrNull(),
            StartWeekday = (Weekday)(int.Parse(me.StartWeekday, CultureInfo.CurrentCulture))
        };
 public void UpdateSettings([FromBody] ClockSettings settings)
 {
     Server.Update(settings.AsSettings());
 }