public async Task RestoreAsync(RestoreContext context, CancellationToken ct) { var json = await context.Reader.ReadJsonAsync <JsonObject>(SettingsFile, ct); await appUISettings.SetAsync(context.AppId, null, json); }
public async Task Should_read_user_settings() { var settings = JsonValue.Object(); var context = CreateRestoreContext(); A.CallTo(() => context.Reader.ReadJsonAsync <JsonObject>(A <string> ._, ct)) .Returns(settings); await sut.RestoreAsync(context, ct); A.CallTo(() => appUISettings.SetAsync(appId, null, settings)) .MustHaveHappened(); }
public async Task <IActionResult> PutSetting(string app, string key, [FromBody] UpdateSettingDto request) { await appUISettings.SetAsync(AppId, null, key, request.Value); return(NoContent()); }
public async Task RestoreAsync(RestoreContext context) { var json = await context.Reader.ReadJsonAttachmentAsync <JsonObject>(SettingsFile); await appUISettings.SetAsync(context.AppId, null, json); }
private async Task ReadSettingsAsync(BackupReader reader, Guid appId) { var json = await reader.ReadJsonAttachmentAsync <JsonObject>(SettingsFile); await appUISettings.SetAsync(appId, null, json); }