noncrud db calls now work
This commit is contained in:
@@ -285,7 +285,7 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF
|
||||
bool hasSignalR;
|
||||
Type type = typeof(T);
|
||||
|
||||
public RestCollection(string baseurl, string endpoint, string hub = null)
|
||||
public RestCollection(string baseurl, string endpoint, string hub = null, bool nonCrud = false)
|
||||
{
|
||||
hasSignalR = hub != null;
|
||||
this.rest = new RestService(baseurl, endpoint);
|
||||
@@ -318,7 +318,21 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF
|
||||
|
||||
this.notify.Init();
|
||||
}
|
||||
Init();
|
||||
|
||||
if (!nonCrud)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
InitCustomEndpoint(endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task InitCustomEndpoint(string endpoint)
|
||||
{
|
||||
items = await rest.GetAsync<T>(endpoint);
|
||||
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
}
|
||||
|
||||
private async Task Init()
|
||||
|
||||
Reference in New Issue
Block a user