From 9e201e4d4d8d386a0b1dba06e68f85e74400af49 Mon Sep 17 00:00:00 2001 From: Michael DiLeo Date: Thu, 6 Aug 2026 11:33:04 -0500 Subject: [PATCH] add dotnet solution --- dotnet/SafelyYou.slnx | 3 ++ dotnet/SafelyYou/Program.cs | 41 +++++++++++++++++++ .../SafelyYou/Properties/launchSettings.json | 23 +++++++++++ dotnet/SafelyYou/SafelyYou.csproj | 13 ++++++ dotnet/SafelyYou/SafelyYou.http | 6 +++ dotnet/SafelyYou/appsettings.Development.json | 8 ++++ dotnet/SafelyYou/appsettings.json | 9 ++++ 7 files changed, 103 insertions(+) create mode 100644 dotnet/SafelyYou.slnx create mode 100644 dotnet/SafelyYou/Program.cs create mode 100644 dotnet/SafelyYou/Properties/launchSettings.json create mode 100644 dotnet/SafelyYou/SafelyYou.csproj create mode 100644 dotnet/SafelyYou/SafelyYou.http create mode 100644 dotnet/SafelyYou/appsettings.Development.json create mode 100644 dotnet/SafelyYou/appsettings.json diff --git a/dotnet/SafelyYou.slnx b/dotnet/SafelyYou.slnx new file mode 100644 index 0000000..f93bb03 --- /dev/null +++ b/dotnet/SafelyYou.slnx @@ -0,0 +1,3 @@ + + + diff --git a/dotnet/SafelyYou/Program.cs b/dotnet/SafelyYou/Program.cs new file mode 100644 index 0000000..ee9d65d --- /dev/null +++ b/dotnet/SafelyYou/Program.cs @@ -0,0 +1,41 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. +// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi +builder.Services.AddOpenApi(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.MapOpenApi(); +} + +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; +}) +.WithName("GetWeatherForecast"); + +app.Run(); + +record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} diff --git a/dotnet/SafelyYou/Properties/launchSettings.json b/dotnet/SafelyYou/Properties/launchSettings.json new file mode 100644 index 0000000..2a9616d --- /dev/null +++ b/dotnet/SafelyYou/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://localhost:5213", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:7175;http://localhost:5213", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/dotnet/SafelyYou/SafelyYou.csproj b/dotnet/SafelyYou/SafelyYou.csproj new file mode 100644 index 0000000..8f692f0 --- /dev/null +++ b/dotnet/SafelyYou/SafelyYou.csproj @@ -0,0 +1,13 @@ + + + + net10.0 + enable + enable + + + + + + + diff --git a/dotnet/SafelyYou/SafelyYou.http b/dotnet/SafelyYou/SafelyYou.http new file mode 100644 index 0000000..3e71c46 --- /dev/null +++ b/dotnet/SafelyYou/SafelyYou.http @@ -0,0 +1,6 @@ +@SafelyYou_HostAddress = http://localhost:5213 + +GET {{SafelyYou_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/dotnet/SafelyYou/appsettings.Development.json b/dotnet/SafelyYou/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/dotnet/SafelyYou/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/dotnet/SafelyYou/appsettings.json b/dotnet/SafelyYou/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/dotnet/SafelyYou/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}