Skip to content

Update README.md to reflect the two NuGet packages using this repo and updated guide on how to initialise for asp.net core. #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@

## Getting started

This repository is the source of two NuGet Packages: *contentful.csharp* and *contentful.aspnetcore*.
We recommend you use the NuGet Package Manager to add the library to your .NET Application using one of the following options:

### contentful.csharp
- In Visual Studio, open Package Manager Console window and run the following command:

```powershell
Expand All @@ -77,6 +79,18 @@ We recommend you use the NuGet Package Manager to add the library to your .NET A
```console
> dotnet add package contentful.csharp
```
### contentful.aspnetcore
- In Visual Studio, open Package Manager Console window and run the following command:

```powershell
PM> Install-Package contentful.aspnetcore
```

- In a command-line, run the following .NET CLI command:

```console
> dotnet add package contentful.aspnetcore
```

## Usage

Expand All @@ -102,7 +116,15 @@ var options = new ContentfulOptions
var client = new ContentfulClient(httpClient, options);
```

If you are running asp.net core and wish to take advantage of [the options pattern][2] you can do so by passing an `IOptions<ContentfulOptions>` to the constructor. This lets you keep your authorization token in your application settings, in environment variables or your own custom `Microsoft.Extensions.Configuration.IConfigurationSource` provider.
If you are running asp.net core and wish to take advantage of [the options pattern][2] you can add the *contentful.aspnetcore* package to your project. You can update your appsettings.json as described here https://www.contentful.com/developers/docs/net/tutorials/aspnet-core/ then in your Program.cs you can add:

```csharp
using Contentful.AspNetCore;


builder.Services.AddContentful(builder.Configuration);
```
This lets you keep your authorization tokens in your application settings.

### Your first request

Expand Down