protected void Save() { var book = CurrentBook; Action <string> action = async(token) => { try { BooksClient.Token = token; await BooksClient.SaveBook(book); } catch { // Let's suppress weird arbitrary errors } UriHelper.NavigateTo("/page/1"); }; ((MonoWebAssemblyJSRuntime)JSRuntime).InvokeUnmarshalled <Action <string>, bool>("blazorDemoInterop.executeWithToken", action); }
protected async void Save() { var book = CurrentBook; Action <string> action = async(token) => { try { BooksClient.Token = token; await BooksClient.SaveBook(book); } catch { // Let's suppress weird arbitrary errors } UriHelper.NavigateTo("/page/1"); }; await JSRuntime.Current.InvokeAsync <bool>("blazorDemoInterop.executeWithToken", action); }
protected async Task Save() { await BooksClient.SaveBook(CurrentBook); UriHelper.NavigateTo("/"); }
protected void Save() { BooksClient.SaveBook(CurrentBook); UriHelper.NavigateTo("/books/index"); }