dotnet / docs-aspire

This repository contains .NET Aspire documentation.
https://learn.microsoft.com/dotnet/aspire
MIT License
81 stars 108 forks source link

Tutorial Restructuring to Illustrate Convenience of Aspire #278

Closed josephaw1022 closed 10 months ago

josephaw1022 commented 10 months ago

Type of issue

Other (describe below)

Description

Summary

I've noticed that the instructions suggest adding the Redis connection string to the appsettings.json file in the ui and api project. While this approach works, I believe it's unnecessary. Instead, it would be more intuitive to first show the "Configure the App Host project" Section and then proceed to the 'Configure the API with Distributed Caching' section, omitting the connection string part altogether.

My suggestion to rearrange the content in this order stems from the opportunity to demonstrate an example of 'Implicit Service Discovery by Reference'. This would also showcase the simplicity of setting up Redis with Aspire.

What I am suggesting for the tutorial structure

Prerequisites

...

Create the project

...

Configure the App Host project

...

Configure the UI with output caching

... (omit connection string)

Configure the API with distributed caching

... (omit connection string)

Test the app locally

...

Explain Some of the Magic of Aspire (New Section)

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/caching/caching-components

Content source URL

https://github.com/dotnet/docs-aspire/blob/main/docs/caching/caching-components.md

Document Version Independent Id

76ef3cc2-e49d-d8da-b6d0-57fac1e9c332

Article author

@IEvangelist


Associated WorkItem - 199395

IEvangelist commented 10 months ago

I'm not opposed to that, but we should at least mention that the connection string option is available to the readers. Would you be interested in creating a pull request @josephaw1022? If so, I could assign this issue to you and review the corresponding PR - just let me know.

josephaw1022 commented 10 months ago

@IEvangelist I agree to your first point and absolutely

josephaw1022 commented 10 months ago

@IEvangelist I noticed the usage of _appsettings.json and not appsettings.json. Is that on purpose or was that just a typo that I can fix?

josephaw1022 commented 10 months ago

I think I figured it out. I am guessing typo from this spike repo that I just made.

https://github.com/josephaw1022/ConnectionStringAspireSpike

IEvangelist commented 10 months ago

@IEvangelist I noticed the usage of _appsettings.json and not appsettings.json. Is that on purpose or was that just a typo that I can fix?

Yeah, that's a typo. All references to files or directories should be styled as italics.