@inject NotificationService notificationService @inject HttpClient http
@if (page == 3) { } else { }
@code { int page = 1; bool canNextPage = false; void HandleFormValidationChanged(bool isValid) { canNextPage = isValid; } void NextPage() => page += (DataToAdd.connectionTypeId == 1) ? 1 : 2; void PrevPage() => page -= (DataToAdd.connectionTypeId == 1) ? 1 : 2; public DTOs.Printer.Add DataToAdd = new() { connectionTypeId = 1, printTypeId = 1, oidForQueryCountPrintedAllTime = "1.3.6.1.2.1.43.10.2.1.4.1.1" }; async Task SendDataToApi() { if (DataToAdd.connectionTypeId == 2) DataToAdd.oidForQueryCountPrintedAllTime = null; await http.PostAsJsonAsync(ApiRoutes.Printer.Add, DataToAdd); Console.WriteLine(JsonConvert.SerializeObject(DataToAdd)); } }