コード例 #1
0
ファイル: FridgeDetailBase.cs プロジェクト: huserben/Frinfo
        protected async void OnRemoveFridge()
        {
            var wasRemoveSuccessful = await FridgeDataService.DeleteFridge(Fridge.HouseholdId, Fridge.FridgeId);

            if (wasRemoveSuccessful)
            {
                NavigationManager.NavigateTo($"household/{Fridge.HouseholdId}");
                ToastService.ShowInfo($"Removed {Fridge.Name}");
            }
            else
            {
                ToastService.ShowError($"Failed to remove {Fridge.Name}", "Delete Failed");
            }
        }
コード例 #2
0
        protected async Task DeleteFridge(Fridge fridge)
        {
            var wasRemoveSuccessfull = await FridgeDataService.DeleteFridge(Household.HouseholdId, fridge.FridgeId);

            if (wasRemoveSuccessfull)
            {
                Fridges.Remove(fridge);
                StateHasChanged();

                ToastService.ShowInfo($"Removed {fridge.Name}");
            }
            else
            {
                ToastService.ShowError($"Failed to remove {fridge.Name}", "Delete Failed");
            }
        }