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

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

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

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