MicrosoftDocs / openapi-docs

Creative Commons Attribution 4.0 International
13 stars 34 forks source link

add documentation on how to configure ASP.NET dependency injection for kiota client #37

Closed baywet closed 5 months ago

baywet commented 1 year ago

initially reported here https://github.com/microsoft/kiota-samples/issues/2104

svrooij commented 7 months ago

@baywet I've just build a complete example on how to use Kiota with Dependency Injection. https://github.com/svrooij/KiotaWithDependencyInjection

baywet commented 7 months ago

Thanks for putting this together! Do you think you'd be up to create a new tutorial (ASP.NET), under a new "Use kiota clients with dependency injection" category, a little like this one? https://learn.microsoft.com/en-us/openapi/kiota/tutorials/dotnet-azure?tabs=portal

svrooij commented 7 months ago

@baywet Yes I do, but I would need some pointers on where to put it and how it works with code samples. Can you help me out with that?

baywet commented 7 months ago

Sure! The source for the tutorial I used as an example is here You could start off by creating a copy and naming it "aspnet-dependencyinjection.md"

Then we'll also need a matching entry here

Do you have additional questions? @jasonjoh to correct me if my guidance was off.

svrooij commented 6 months ago

@baywet I was trying to start with it and found the the uses pointers to external code samples. Where are they located and is it also allowed to just include the code for the samples in a markdown code block?

https://github.com/MicrosoftDocs/openapi-docs/blob/0d7d8cb31729b229241371454eb15dad0fd4e3e3/OpenAPI/kiota/tutorials/dotnet-azure.md?plain=1#L57

baywet commented 6 months ago

This is driven by this configuration and ultimately points to this file

I'd say we'd have a preference aligning with this approach this way:

what do you think?