Creation
This commit is contained in:
32
Client/Pages/FetchServiceShopOrders.razor.cs
Normal file
32
Client/Pages/FetchServiceShopOrders.razor.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using Expose.MyIT.Shared.ViewModels;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Net.Http.Json;
|
||||
|
||||
namespace Expose.MyIT.Client.Pages;
|
||||
|
||||
public partial class FetchServiceShopOrders
|
||||
{
|
||||
|
||||
[Inject] protected HttpClient? Http { get; set; }
|
||||
|
||||
private ServiceShopOrder[]? _ServiceShopOrders;
|
||||
|
||||
//Id
|
||||
//Name
|
||||
//BookingNames
|
||||
//Type
|
||||
//State
|
||||
//ItemNumber
|
||||
//CreatedDate
|
||||
//DecidedDate
|
||||
//Recipient
|
||||
//Requestor
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Http is null)
|
||||
throw new NullReferenceException(nameof(Http));
|
||||
string controllerName = MyIT.Shared.Models.Stateless.Methods.IServiceShopOrderController.GetRouteName();
|
||||
_ServiceShopOrders = await Http.GetFromJsonAsync<ServiceShopOrder[]>($"api/{controllerName}");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user