Skip to content

Commit 6af921d

Browse files
committed
Add sample for create empty builder
1 parent 66be1a4 commit 6af921d

File tree

6 files changed

+40
-3
lines changed

6 files changed

+40
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Samples for ASP.NET Core 6.0, 7.0 and 8.0 Preview 7 (493)
1+
# Samples for ASP.NET Core 6.0, 7.0 and 8.0 Preview 7 (494)
22

3-
- Samples for ASP.NET Core **8.0 Preview 7** is available [here](/projects/.net8) (31).
3+
- Samples for ASP.NET Core **8.0 Preview 7** is available [here](/projects/.net8) (32).
44
- Samples for ASP.NET Core **7.0** is available [here](/projects/.net7) (45).
55
- Samples for ASP.NET Core **8.0 Preview 6** using EdgeDB.NET is [here](https://github.com/edgedb/edgedb-net).
66

projects/.net8/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ASP.NET 8.0 Preview 7 (31)
1+
# ASP.NET 8.0 Preview 7 (32)
22

33
These samples require [.NET 8.0 Preview 7](https://github.com/dotnet/installer#table).
44

@@ -70,6 +70,10 @@ These samples require [.NET 8.0 Preview 7](https://github.com/dotnet/installer#t
7070

7171
`WebApplication.CreateSlimBuilder` creates `WebApplicationBuilder` with minimal configuration defaults.
7272

73+
* [EmptyBuilder](empty-builder)
74+
75+
`WebApplication.CreateEmptyBuilder` creates `WebApplicationBuilder` with no built-in behavior.
76+
7377
## Blazor SSR Form Handling
7478

7579
* [RazorFormHandlingOne](RazorFormHandlingOne)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dotnet.defaultSolution": "empty-builder.sln"
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var builder = WebApplication.CreateEmptyBuilder(new WebApplicationOptions());
2+
builder.WebHost.UseKestrelCore();
3+
builder.Services.AddRouting();
4+
5+
var app = builder.Build();
6+
7+
app.MapGet("/", () => {
8+
return Results.Content("""
9+
<html>
10+
<body>
11+
hello world with WebApplication.CreateEmptyBuilder()
12+
</body>
13+
</html>
14+
""", "text/html");
15+
});
16+
17+
app.Run();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# WebApplication.CreateEmptyBuilder
2+
3+
`WebApplication.CreateEmptyBuilder` creates `WebApplicationBuilder` with no built-in behavior. You will need to add services and middleware as needed.
4+
5+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<ImplicitUsings>true</ImplicitUsings>
5+
<LangVersion>preview</LangVersion>
6+
<PreviewFeatures>true</PreviewFeatures>
7+
</PropertyGroup>
8+
</Project>

0 commit comments

Comments
 (0)