From 62be9f4a5051cbc19d5606ca6929b7d062ab513b Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 28 Nov 2020 23:48:29 +0200 Subject: [PATCH] Notes update + await warnings fix --- NetworkResurrector.Application/Services/UserService.cs | 4 ++-- Notes.txt | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NetworkResurrector.Application/Services/UserService.cs b/NetworkResurrector.Application/Services/UserService.cs index d322fb9..20e69eb 100644 --- a/NetworkResurrector.Application/Services/UserService.cs +++ b/NetworkResurrector.Application/Services/UserService.cs @@ -32,7 +32,7 @@ namespace NetworkResurrector.Application.Services return null; var token = $"{Guid.NewGuid()}-{Guid.NewGuid()}-{user.UserId}"; - _securityStore.SetToken(token, user.UserId); + await Task.Run(() =>_securityStore.SetToken(token, user.UserId)); var securityToken = new SecurityToken() { UserId = user.UserId, Token = token }; return securityToken; @@ -40,7 +40,7 @@ namespace NetworkResurrector.Application.Services public async Task Authenticate(string token) { - var tokenValidation = _securityStore.ValidateToken(token); + var tokenValidation = await Task.Run(() => _securityStore.ValidateToken(token)); if (tokenValidation.Success) { var user = _paramProvider.Users.FirstOrDefault(z => z.UserId == tokenValidation.UserId); diff --git a/Notes.txt b/Notes.txt index dc06018..0478467 100644 --- a/Notes.txt +++ b/Notes.txt @@ -1,2 +1,9 @@ https://github.com/nikeee/wake-on-lan +####################################################################################################################################################### +Publish: +dotnet publish --configuration Release --runtime win7-x64 + +Create windows service: +sc create NetworkResurrector.Api binPath= "" +####################################################################################################################################################### \ No newline at end of file