Skip to content

Commit 475efe7

Browse files
committed
Another keyed service sample for MVC
1 parent c312dd5 commit 475efe7

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
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 RC 1 (495)
1+
# Samples for ASP.NET Core 6.0, 7.0 and 8.0 RC 1 (496)
22

3-
- Samples for ASP.NET Core **8.0 RC 1** is available [here](/projects/.net8) (33).
3+
- Samples for ASP.NET Core **8.0 RC 1** is available [here](/projects/.net8) (34).
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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ASP.NET 8.0 Preview 7 (33)
1+
# ASP.NET 8.0 Preview 7 (34)
22

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

@@ -140,6 +140,10 @@ These samples require [.NET 8.0 RC 1](https://github.com/dotnet/installer#table)
140140

141141
## Keyed Services
142142

143-
* [Keyed Services in Minimal API]
143+
* [Keyed Services in Minimal API](keyed-service)
144144

145-
Use `IServiceProvider.GetRequiredKeyedService<T>(key)` to get different type of implementation instances based on string key in Minimal API
145+
Use `IServiceProvider.GetRequiredKeyedService<T>(key)` to get different type of implementation instances based on string key in Minimal API
146+
147+
* [Keyed Services in MVC](keyed-service-2)
148+
149+
Use `IServiceProvider.GetRequiredKeyedService<T>(key)` to get different type of implementation instances based on string key in MVC

projects/.net8/keyed-service-2/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ string GetServiceKey()
3939
var key = GetServiceKey();
4040
var greeting = _keyProvider.GetRequiredKeyedService<IGreeting>(key);
4141

42-
return Content("""
42+
return Content($$"""
4343
<html>
4444
<body>
45-
{{ greeting.Message }}}
45+
{{ greeting.Message }}
4646
</body>
4747
</html>
4848
""", "text/html");

0 commit comments

Comments
 (0)