Skip to content

Commit 8dfc74e

Browse files
committed
Update readme to add new factory method
1 parent acdaaa7 commit 8dfc74e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,28 @@ PM> Install-Package MatthiWare.FinancialModelingPrep
1111

1212
# Quick Start
1313

14-
Register FinancialModelingPrepApiClient in Dependency Injection provider
14+
### Register FinancialModelingPrepApiClient in Dependency Injection provider
1515
> You can find your API Key here https://financialmodelingprep.com/developer/docs/dashboard
1616
``` csharp
17+
using MatthiWare.FinancialModelingPrep;
18+
1719
Services.AddFinancialModelingPrepApiClient(new FinancialModelingPrepOptions()
1820
{
1921
ApiKey = "API-KEY-HERE"
2022
});
23+
24+
var api = ServiceProvider.GetRequiredService<IFinancialModelingPrepApiClient>();
25+
26+
// do something with api like getting the latest Apple Stock Quote
27+
var quoteResult = await api.CompanyValuation.GetQuoteAsync("AAPL");
2128
```
2229

23-
### Resolve FMP API Client
30+
### Create FMP API Client using Factory (without Dependency Injection)
2431

25-
``` csharp
26-
var api = ServiceProvider.GetRequiredService<IFinancialModelingPrepApiClient>();
32+
```csharp
33+
using MatthiWare.FinancialModelingPrep;
34+
35+
var api = FinancialModelingPrepApiClientFactory.CreateClient(new FinancialModelingPrepOptions());
2736

2837
// do something with api like getting the latest Apple Stock Quote
2938
var quoteResult = await api.CompanyValuation.GetQuoteAsync("AAPL");

0 commit comments

Comments
 (0)