// validation protected async Task HandleValidSubmit() { if (ChaseViewModel.Attribute1 == NullOption) { ChaseViewModel.Attribute1 = null; } if (ChaseViewModel.Attribute2 == NullOption) { ChaseViewModel.Attribute2 = null; } if (ChaseViewModel.Jutsu1 == NullOption) { ChaseViewModel.Jutsu1 = null; } if (ChaseViewModel.Jutsu2 == NullOption) { ChaseViewModel.Jutsu2 = null; } if (ChaseViewModel.Causing == NullOption) { ChaseViewModel.Causing = null; } ChaseViewModel.Hits = int.Parse(stringHits); ChaseViewModel.Repeat = int.Parse(stringRepeat); ChaseModel = ChaseViewModel; await ChaseViewModelService.UpdateChase(long.Parse(Id), ChaseModel); NavigationManager.NavigateTo("chases"); }
// validation protected async Task HandleValidCreate() { if (ChaseViewModel.Attribute1 == NullOption) { ChaseViewModel.Attribute1 = null; } if (ChaseViewModel.Attribute2 == NullOption) { ChaseViewModel.Attribute2 = null; } if (ChaseViewModel.Jutsu1 == NullOption) { ChaseViewModel.Jutsu1 = null; } if (ChaseViewModel.Jutsu2 == NullOption) { ChaseViewModel.Jutsu2 = null; } if (ChaseViewModel.Causing == NullOption) { ChaseViewModel.Causing = null; } ChaseViewModel.Hits = int.Parse(stringHits); ChaseViewModel.Repeat = int.Parse(stringRepeat); ChaseModel = ChaseViewModel; await ChaseViewModelService.CreateChase(ChaseModel); Back_Click(); }
protected override async Task OnInitializedAsync() { ChaseModel = await ChaseViewModelService.GetChase(long.Parse(Id)); BackRoute = $"chases/{Id}"; ChaseViewModel = ChaseModel; }