public ScreenSaverPlaylist GetScreenSaverPlaylist(Config entity) { ScreenSaverPlaylist playlist = null; if (entity.ScreenSaverPlaylist != null) { playlist = JsonConvert.DeserializeObject <ScreenSaverPlaylist>(entity.ScreenSaverPlaylist); } if (playlist == null) { playlist = new ScreenSaverPlaylist(); } return(playlist); }
public void UpdateScreenSaverPlaylist(Config entity, ScreenSaverPlaylist model) { model.Medias = model.Medias?.OrderBy(m => m.Position).ToList(); entity.ScreenSaverPlaylist = JsonConvert.SerializeObject(model); }