Initial commit.
This commit is contained in:
1 parent
fd81c63020
commit
39c8b861c0
44 files changed
+1144
-4
No files matched your search
@@ -0,0 +1,21 @@
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using ClientApiPoC.Shared.Models;
|
||||
|
||||
namespace ClientApiPoC.OnPremiseApp.Services {
|
||||
public class ClientDataService {
|
||||
public string? ClientData { get; set; } = null;
|
||||
|
||||
public async Task<ClientDataModel> GetClientDataAsync(DateTime timestampServer) {
|
||||
return new ClientDataModel() {
|
||||
Data = this.ClientData,
|
||||
TimestampServerUtc = timestampServer,
|
||||
TimestampClientUtc = DateTime.UtcNow
|
||||
};
|
||||
}
|
||||
|
||||
public void ConfigureTunnelActions(HubConnection tunnelConnection) {
|
||||
if (tunnelConnection == null) throw new ArgumentNullException(nameof(tunnelConnection));
|
||||
tunnelConnection.On<DateTime, ClientDataModel>("GetClientData", GetClientDataAsync);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user