diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-04-25 00:10:17 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-04-25 00:10:17 +0200 |
| commit | 4322330745d18bb28f7deee1a54ae3c748645d92 (patch) | |
| tree | e533be4f7630fc4eb53457c0566ab93ec41995a2 /src/Data/General | |
| download | dotnet-webapi-template-4322330745d18bb28f7deee1a54ae3c748645d92.tar.xz dotnet-webapi-template-4322330745d18bb28f7deee1a54ae3c748645d92.zip | |
Initial commit
Diffstat (limited to 'src/Data/General')
| -rw-r--r-- | src/Data/General/AppPath.cs | 27 | ||||
| -rw-r--r-- | src/Data/General/LoggedInUser.cs | 10 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/Data/General/AppPath.cs b/src/Data/General/AppPath.cs new file mode 100644 index 0000000..241cf65 --- /dev/null +++ b/src/Data/General/AppPath.cs @@ -0,0 +1,27 @@ +using System.IO; +using IOL.Helpers; + +namespace IOL.WebApi.Template.Data.General +{ + public sealed record AppPath + { + public string HostPath { get; init; } + public string WebPath { get; init; } + + public string GetHostPathForFilename(string filename, string fallback = "") { + if (filename.IsNullOrWhiteSpace()) { + return fallback; + } + + return Path.Combine(HostPath, filename); + } + + public string GetWebPathForFilename(string filename, string fallback = "") { + if (filename.IsNullOrWhiteSpace()) { + return fallback; + } + + return Path.Combine(WebPath, filename); + } + } +} diff --git a/src/Data/General/LoggedInUser.cs b/src/Data/General/LoggedInUser.cs new file mode 100644 index 0000000..d278d3f --- /dev/null +++ b/src/Data/General/LoggedInUser.cs @@ -0,0 +1,10 @@ +using System; + +namespace IOL.WebApi.Template.Data.General +{ + public class LoggedInUser + { + public Guid Id { get; set; } + public string Username { get; set; } + } +} |
