예제 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            App    = _settingsService.App;
            BtcPay = _settingsService.BtcPay;

            var results = await Task.WhenAll(new List <Task <bool> >
            {
                TryUpdateModelAsync(App, "App", w => w.Name),
                TryUpdateModelAsync(BtcPay, "BtcPay", w => w.Endpoint, w => w.StoreId, w => w.ApiKey)
            });

            if (results.All(r => r))
            {
                await _settingsService.SaveAsync();

                return(RedirectToPage("./Edit"));
            }

            return(Page());
        }
예제 #2
0
 public void OnGet()
 {
     App    = _settingsService.App;
     BtcPay = _settingsService.BtcPay;
 }