Exemple #1
0
        public async Task RestoreAsync(RestoreContext context,
                                       CancellationToken ct)
        {
            var json = await context.Reader.ReadJsonAsync <JsonObject>(SettingsFile, ct);

            await appUISettings.SetAsync(context.AppId, null, json);
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        public async Task <IActionResult> PutSetting(string app, string key, [FromBody] UpdateSettingDto request)
        {
            await appUISettings.SetAsync(AppId, null, key, request.Value);

            return(NoContent());
        }
Exemple #4
0
        public async Task RestoreAsync(RestoreContext context)
        {
            var json = await context.Reader.ReadJsonAttachmentAsync <JsonObject>(SettingsFile);

            await appUISettings.SetAsync(context.AppId, null, json);
        }
Exemple #5
0
        private async Task ReadSettingsAsync(BackupReader reader, Guid appId)
        {
            var json = await reader.ReadJsonAttachmentAsync <JsonObject>(SettingsFile);

            await appUISettings.SetAsync(appId, null, json);
        }