Skip to content

Commit

Permalink
Fix code format in how-to-implement-dependency-injection.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi authored Jul 18, 2024
1 parent c250c75 commit 2a846fe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ dotnet add package Microsoft.Extensions.DependencyInjection
The following code is creating an extension method for `IServiceCollection` that will register services to our service collection and make them available for injection.

```csharp
public static class ServiceCollectionExtensions {
public static void AddCommonServices(this IServiceCollection collection) {
public static class ServiceCollectionExtensions
{
public static void AddCommonServices(this IServiceCollection collection)
{
collection.AddSingleton<IRepository, Repository>();
collection.AddTransient<BusinessService>();
collection.AddTransient<MainViewModel>();
Expand Down

0 comments on commit 2a846fe

Please sign in to comment.