protected async Task HandleVilideSubmit() { await HouseSevices.AddHome(House); NavigationManager.NavigateTo("/listhomes"); // http.PostAsJsonAsync($"{url}/api/Houses/addHouse", House); }
protected async Task HandleVilideSubmit() { await HouseSevices.UpdateHome(House); // await http.PutAsJsonAsync($"{url}/api/Houses/UpdateHouse/{Id}", House); NavigationManager.NavigateTo("/listhomes"); }
protected override async Task OnInitializedAsync() { Landlords = await LandlordServices.GetLandlords(); //Landlords = await http.GetFromJsonAsync<LandlordDto[]>($"{url}/api/Landlords/GetLandlords"); House = await HouseSevices.GetHouseById(Id); //House = await http.GetFromJsonAsync<HouseEditDto>($"{url}/api/Houses/GetHouseById/{Id}"); }
// string url = "https://lettings-manager.azurewebsites.net"; protected override async Task OnInitializedAsync() { try { IsLoading = true; Houses = await HouseSevices.GetHouses(); //Houses = await http.GetFromJsonAsync<ReturnHousesDto[]>($"{url}/api/Houses/GetHouses"); DataSource = Houses; SearchSource = Houses; PageCount = (int)Math.Ceiling((int)DataSource.Length / (decimal)ItemPerPage); Paginate(0); IsLoading = false; ToastService.ShowInfo("House Loaded", "Home list"); } catch (Exception) { IsLoading = false; ToastService.ShowError("Error Loading List"); throw; } }