public async Task SaveAsync(QuestionBoard board) { var json = System.Text.Json.JsonSerializer.Serialize <QuestionBoard>(board); var file = BuildBoardFilePath(board); await File.WriteAllTextAsync(BuildBoardFilePath(board), json, Encoding.UTF8); }
public void Delete(QuestionBoard board) { File.Delete(BuildBoardFilePath(board)); }
private string BuildBoardFileName(QuestionBoard board) { return($"Feud.{board.Id}.{board.CreatedDate:yyyyMMddHHmmss}.json"); }
private string BuildBoardFilePath(QuestionBoard board) { return(Path.Combine(SaveFolder, BuildBoardFileName(board))); }
public void AddBoard(QuestionBoard newBoard) { Boards.Add(newBoard); }