Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 03dcae2

Browse files
Simplify docs
1 parent f0d954b commit 03dcae2

File tree

1 file changed

+4
-11
lines changed
  • src/Microsoft.AspNetCore.NodeServices

1 file changed

+4
-11
lines changed

src/Microsoft.AspNetCore.NodeServices/README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,9 @@ In that case, you don't need to use NodeServices directly (or install it manuall
4343

4444
## For ASP.NET Core apps
4545

46-
ASP.NET Core has a built-in dependency injection (DI) system. NodeServices is designed to work with this, so you don't have to manage the creation or disposal of instances.
46+
.NET Core has a built-in dependency injection (DI) system. NodeServices is designed to work with this, so you don't have to manage the creation or disposal of instances.
4747

48-
Enable NodeServices in your application by first adding the following to the top of your `Startup.cs` file:
49-
50-
```csharp
51-
using Microsoft.AspNetCore.NodeServices;
52-
```
53-
54-
... and then add to your `ConfigureServices` method in that file:
48+
Enable NodeServices in your application by first adding the following to your `ConfigureServices` method in `Startup.cs`:
5549

5650
```csharp
5751
public void ConfigureServices(IServiceCollection services)
@@ -93,7 +87,6 @@ If you want to put `addNumber.js` inside a subfolder rather than the root of you
9387
In other types of .NET Core app, where you don't have ASP.NET supplying an `IServiceCollection` to you, you'll need to instantiate your own DI container. For example, add a reference to the .NET package `Microsoft.Extensions.DependencyInjection`, and then you can construct an `IServiceCollection`, then register NodeServices as usual:
9488

9589
```csharp
96-
// Remember to add 'using Microsoft.AspNetCore.NodeServices;' at the top of your file
9790
var services = new ServiceCollection();
9891
services.AddNodeServices(options => {
9992
// Set any properties that you want on 'options' here
@@ -133,10 +126,10 @@ AddNodeServices(Action<NodeServicesOptions> setupAction)
133126

134127
This is an extension method on `IServiceCollection`. It registers NodeServices with ASP.NET Core's DI system. Typically you should call this from the `ConfigureServices` method in your `Startup.cs` file.
135128

136-
To access this extension method, you'll need to add the following namespace import to the top of your file:
129+
To access this extension method, you'll need to add the following namespace import to the top of your file, if it isn't already there:
137130

138131
```csharp
139-
using Microsoft.AspNetCore.NodeServices;
132+
using Microsoft.Extensions.DependencyInjection;
140133
```
141134

142135
**Examples**

0 commit comments

Comments
 (0)