diff --git a/DougShared/Class1.cs b/DougShared/Class1.cs new file mode 100644 index 0000000..0c59c6d --- /dev/null +++ b/DougShared/Class1.cs @@ -0,0 +1,7 @@ +namespace DougShared +{ + public class Class1 + { + + } +} diff --git a/DougShared/DougShared.csproj b/DougShared/DougShared.csproj new file mode 100644 index 0000000..fa71b7a --- /dev/null +++ b/DougShared/DougShared.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/DoughnutApi/Controllers/WeatherForecastController.cs b/DoughnutApi/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..a5bd32d --- /dev/null +++ b/DoughnutApi/Controllers/WeatherForecastController.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; + +namespace DoughnutApi.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable Get() + { + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = Summaries[Random.Shared.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} diff --git a/DoughnutApi/DoughnutApi.csproj b/DoughnutApi/DoughnutApi.csproj new file mode 100644 index 0000000..ba558e4 --- /dev/null +++ b/DoughnutApi/DoughnutApi.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + true + + + + + + + diff --git a/DoughnutApi/DoughnutApi.http b/DoughnutApi/DoughnutApi.http new file mode 100644 index 0000000..b8317f4 --- /dev/null +++ b/DoughnutApi/DoughnutApi.http @@ -0,0 +1,6 @@ +@DoughnutApi_HostAddress = http://localhost:5090 + +GET {{DoughnutApi_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/DoughnutApi/Program.cs b/DoughnutApi/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/DoughnutApi/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add services to the container. + +builder.Services.AddControllers(); +// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/DoughnutApi/Properties/launchSettings.json b/DoughnutApi/Properties/launchSettings.json new file mode 100644 index 0000000..f2a8561 --- /dev/null +++ b/DoughnutApi/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:18401", + "sslPort": 44309 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5090", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7279;http://localhost:5090", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/DoughnutApi/WeatherForecast.cs b/DoughnutApi/WeatherForecast.cs new file mode 100644 index 0000000..fa89ed8 --- /dev/null +++ b/DoughnutApi/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace DoughnutApi +{ + public class WeatherForecast + { + public DateOnly Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/DoughnutApi/appsettings.Development.json b/DoughnutApi/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DoughnutApi/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DoughnutApi/appsettings.json b/DoughnutApi/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/DoughnutApi/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/DoughnutApp.sln b/DoughnutApp.sln new file mode 100644 index 0000000..47e3895 --- /dev/null +++ b/DoughnutApp.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34511.84 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DoughnutApp", "DoughnutApp\DoughnutApp.csproj", "{033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DoughnutApi", "DoughnutApi\DoughnutApi.csproj", "{B2BB3238-D5AF-4776-9C69-D56CA5024839}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DougShared", "DougShared\DougShared.csproj", "{55F084A3-4F5A-4F50-9F3B-79C93133B64E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Release|Any CPU.Build.0 = Release|Any CPU + {033F76B9-EF3E-4EBA-A5CE-A8AF2C57944E}.Release|Any CPU.Deploy.0 = Release|Any CPU + {B2BB3238-D5AF-4776-9C69-D56CA5024839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2BB3238-D5AF-4776-9C69-D56CA5024839}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2BB3238-D5AF-4776-9C69-D56CA5024839}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2BB3238-D5AF-4776-9C69-D56CA5024839}.Release|Any CPU.Build.0 = Release|Any CPU + {55F084A3-4F5A-4F50-9F3B-79C93133B64E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55F084A3-4F5A-4F50-9F3B-79C93133B64E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55F084A3-4F5A-4F50-9F3B-79C93133B64E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55F084A3-4F5A-4F50-9F3B-79C93133B64E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F831354C-8457-45EC-872F-0BB9C423FAA4} + EndGlobalSection +EndGlobal diff --git a/DoughnutApp/App.xaml b/DoughnutApp/App.xaml new file mode 100644 index 0000000..091cd40 --- /dev/null +++ b/DoughnutApp/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/DoughnutApp/App.xaml.cs b/DoughnutApp/App.xaml.cs new file mode 100644 index 0000000..a6cc832 --- /dev/null +++ b/DoughnutApp/App.xaml.cs @@ -0,0 +1,12 @@ +namespace DoughnutApp +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } + } +} diff --git a/DoughnutApp/AppShell.xaml b/DoughnutApp/AppShell.xaml new file mode 100644 index 0000000..3165444 --- /dev/null +++ b/DoughnutApp/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/DoughnutApp/AppShell.xaml.cs b/DoughnutApp/AppShell.xaml.cs new file mode 100644 index 0000000..57606b1 --- /dev/null +++ b/DoughnutApp/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace DoughnutApp +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/DoughnutApp/DoughnutApp.csproj b/DoughnutApp/DoughnutApp.csproj new file mode 100644 index 0000000..f3f258b --- /dev/null +++ b/DoughnutApp/DoughnutApp.csproj @@ -0,0 +1,65 @@ + + + + net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + + + + + Exe + DoughnutApp + true + true + enable + enable + + + DoughnutApp + + + com.companyname.doughnutapp + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DoughnutApp/MainPage.xaml b/DoughnutApp/MainPage.xaml new file mode 100644 index 0000000..8809b8b --- /dev/null +++ b/DoughnutApp/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + +