Skip to content

Commit 9e4fb54

Browse files
committed
README upated
1 parent 3f0ff32 commit 9e4fb54

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ public void ConfigureServices(IServiceCollection services)
2929
services.AddMvc();
3030
}
3131
```
32+
33+
#### Example Dependency Injection
34+
```csharp
35+
public class TestController : Controller
36+
{
37+
private readonly IGuidelineApi _api;
38+
39+
public TestController(IGuidelineApi api)
40+
{
41+
_api = api;
42+
}
43+
44+
public async Task<IActionResult> GetPostsAsync()
45+
{
46+
var items = await _api.GetPostsAsync();
47+
return Json(items);
48+
}
49+
}
50+
```
51+
3252
#### Add Configuration Section to the appsettings.json file (or your configuration file)
3353
##### Example for development environment:
3454
```json

0 commit comments

Comments
 (0)