Skip to content

Commit cb91e52

Browse files
Init
0 parents  commit cb91e52

File tree

8 files changed

+575
-0
lines changed

8 files changed

+575
-0
lines changed

.gitignore

Lines changed: 478 additions & 0 deletions
Large diffs are not rendered by default.

.idea/.idea.EDI/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.EDI/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.EDI/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.EDI/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DemoServer/DemoServer.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<NoDefaultLaunchSettingsFile>True</NoDefaultLaunchSettingsFile>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0-rc.2.24474.3"/>
12+
<PackageReference Include="Scalar.AspNetCore" Version="1.2.16" />
13+
</ItemGroup>
14+
15+
</Project>

DemoServer/Program.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Scalar.AspNetCore;
2+
3+
var builder = WebApplication.CreateBuilder(args);
4+
builder.Services.AddOpenApi();
5+
6+
var app = builder.Build();
7+
app.MapOpenApi();
8+
app.MapScalarApiReference();
9+
app.UseHttpsRedirection();
10+
11+
var summaries = new[]
12+
{
13+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
14+
};
15+
16+
app.MapGet("/weatherforecast", () =>
17+
{
18+
var forecast = Enumerable.Range(1, 5).Select(index =>
19+
new WeatherForecast
20+
(
21+
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
22+
Random.Shared.Next(-20, 55),
23+
summaries[Random.Shared.Next(summaries.Length)]
24+
))
25+
.ToArray();
26+
return forecast;
27+
})
28+
.WithName("GetWeatherForecast");
29+
30+
app.Run();
31+
32+
record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
33+
{
34+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
35+
}

EDI.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoServer", "DemoServer\DemoServer.csproj", "{C9439CAA-2672-4BAF-B6B2-2DB92F08ADBD}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{C9439CAA-2672-4BAF-B6B2-2DB92F08ADBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{C9439CAA-2672-4BAF-B6B2-2DB92F08ADBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{C9439CAA-2672-4BAF-B6B2-2DB92F08ADBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{C9439CAA-2672-4BAF-B6B2-2DB92F08ADBD}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

0 commit comments

Comments
 (0)