diff --git a/AccountTracking.sln b/AccountTracking.sln new file mode 100644 index 0000000..8308ee0 --- /dev/null +++ b/AccountTracking.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1A128832-A516-43AF-B7A5-3124FC2F7A74}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountTracking.Api", "src\AccountTracking.Api\AccountTracking.Api.csproj", "{F173558B-FA34-4B12-A545-BDB64BA7CDCB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountTracking.Api.Tests", "src\AccountTracking.Api.Tests\AccountTracking.Api.Tests.csproj", "{0986E9DA-6758-4FA1-863F-9A60A35D86E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F173558B-FA34-4B12-A545-BDB64BA7CDCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F173558B-FA34-4B12-A545-BDB64BA7CDCB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F173558B-FA34-4B12-A545-BDB64BA7CDCB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F173558B-FA34-4B12-A545-BDB64BA7CDCB}.Release|Any CPU.Build.0 = Release|Any CPU + {0986E9DA-6758-4FA1-863F-9A60A35D86E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0986E9DA-6758-4FA1-863F-9A60A35D86E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0986E9DA-6758-4FA1-863F-9A60A35D86E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0986E9DA-6758-4FA1-863F-9A60A35D86E5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {F173558B-FA34-4B12-A545-BDB64BA7CDCB} = {1A128832-A516-43AF-B7A5-3124FC2F7A74} + {0986E9DA-6758-4FA1-863F-9A60A35D86E5} = {1A128832-A516-43AF-B7A5-3124FC2F7A74} + EndGlobalSection +EndGlobal diff --git a/src/AccountTracking.Api.Tests/AccountTracking.Api.Tests.csproj b/src/AccountTracking.Api.Tests/AccountTracking.Api.Tests.csproj new file mode 100644 index 0000000..1dfcf58 --- /dev/null +++ b/src/AccountTracking.Api.Tests/AccountTracking.Api.Tests.csproj @@ -0,0 +1,30 @@ + + + + net8.0 + enable + enable + + false + true + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/src/AccountTracking.Api.Tests/GlobalUsings.cs b/src/AccountTracking.Api.Tests/GlobalUsings.cs new file mode 100644 index 0000000..8c927eb --- /dev/null +++ b/src/AccountTracking.Api.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/AccountTracking.Api.Tests/UnitTest1.cs b/src/AccountTracking.Api.Tests/UnitTest1.cs new file mode 100644 index 0000000..c3a8ebd --- /dev/null +++ b/src/AccountTracking.Api.Tests/UnitTest1.cs @@ -0,0 +1,10 @@ +namespace AccountTracking.Api.Tests; + +public class UnitTest1 +{ + [Fact] + public void Test1() + { + + } +} \ No newline at end of file diff --git a/src/AccountTracking.Api/AccountTracking.Api.csproj b/src/AccountTracking.Api/AccountTracking.Api.csproj new file mode 100644 index 0000000..4db8de7 --- /dev/null +++ b/src/AccountTracking.Api/AccountTracking.Api.csproj @@ -0,0 +1,32 @@ + + + + net8.0 + enable + enable + true + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + diff --git a/src/AccountTracking.Api/AccountTracking.Api.http b/src/AccountTracking.Api/AccountTracking.Api.http new file mode 100644 index 0000000..18865fb --- /dev/null +++ b/src/AccountTracking.Api/AccountTracking.Api.http @@ -0,0 +1,6 @@ +@AccountTracking.Api_HostAddress = http://localhost:5074 + +GET {{AccountTracking.Api_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/AccountTracking.Api/Program.cs b/src/AccountTracking.Api/Program.cs new file mode 100644 index 0000000..9327932 --- /dev/null +++ b/src/AccountTracking.Api/Program.cs @@ -0,0 +1,34 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +var app = builder.Build(); + +// Configure the HTTP request pipeline. + +app.UseHttpsRedirection(); + +var summaries = new[] +{ + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" +}; + +app.MapGet("/weatherforecast", () => +{ + var forecast = Enumerable.Range(1, 5).Select(index => + new WeatherForecast + ( + DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + Random.Shared.Next(-20, 55), + summaries[Random.Shared.Next(summaries.Length)] + )) + .ToArray(); + return forecast; +}); + +app.Run(); + +record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} diff --git a/src/AccountTracking.Api/Properties/launchSettings.json b/src/AccountTracking.Api/Properties/launchSettings.json new file mode 100644 index 0000000..6279a63 --- /dev/null +++ b/src/AccountTracking.Api/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:59363", + "sslPort": 44369 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "http://localhost:5074", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "https://localhost:7024;http://localhost:5074", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "weatherforecast", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/AccountTracking.Api/appsettings.Development.json b/src/AccountTracking.Api/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/AccountTracking.Api/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/AccountTracking.Api/appsettings.json b/src/AccountTracking.Api/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/src/AccountTracking.Api/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}