File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -11,19 +11,28 @@ PM> Install-Package MatthiWare.FinancialModelingPrep
11
11
12
12
# Quick Start
13
13
14
- Register FinancialModelingPrepApiClient in Dependency Injection provider
14
+ ### Register FinancialModelingPrepApiClient in Dependency Injection provider
15
15
> You can find your API Key here https://financialmodelingprep.com/developer/docs/dashboard
16
16
``` csharp
17
+ using MatthiWare .FinancialModelingPrep ;
18
+
17
19
Services .AddFinancialModelingPrepApiClient (new FinancialModelingPrepOptions ()
18
20
{
19
21
ApiKey = " API-KEY-HERE"
20
22
});
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" );
21
28
```
22
29
23
- ### Resolve FMP API Client
30
+ ### Create FMP API Client using Factory (without Dependency Injection)
24
31
25
- ``` csharp
26
- var api = ServiceProvider .GetRequiredService <IFinancialModelingPrepApiClient >();
32
+ ``` csharp
33
+ using MatthiWare .FinancialModelingPrep ;
34
+
35
+ var api = FinancialModelingPrepApiClientFactory .CreateClient (new FinancialModelingPrepOptions ());
27
36
28
37
// do something with api like getting the latest Apple Stock Quote
29
38
var quoteResult = await api .CompanyValuation .GetQuoteAsync (" AAPL" );
You can’t perform that action at this time.
0 commit comments