Redis Cache, PostgreSQL Databases, Messaging, & More with .NET Aspire

Ғылым және технология

Let's go a bit deeper on .NET Aspire by integrating components into our .NET Web API and Blazor Web app to go beyond orchestration and service discovery. Today we will upgrade our database to PostgresSQL with pgAdmin to see our scaffolded database from EF Core. We will also look at how to add output caching with Redis Cache in our Blazor front end.
Links:
Code: github.com/jamesmontemagno/eS...
.NET Aspire: learn.microsoft.com/dotnet/as...
Chapters:
00:00 - Intro
00:52 - App Walkthrough with .NET Aspire Orchestration
02:20 - Adding PostgreSQL Database in Web API
09:15 - Caching Options
09:50 - Adding Redis Cache for Output Caching
15:17 - Wrap-up
Join this channel to get access to perks:
/ @jamesmontemagno
👕 Buy some swag! - jamesmontemagno.myspreadshop....
☕️ Buy me a coffee - www.buymeacoffee.com/jamesmon...
Follow:
👨‍💻 GitHub: github.com/jamesmontemagno
🦜 Twitter: / jamesmontemagno
📄 Website: www.montemagno.com
📰 Newsletter: newsletter.montemagno.com/
Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: cleclothingco.myshopify.com/
What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre: / bcez1onhiqx
My Setup:
📷 Canon M50 Mark II - amzn.to/3P8R7lp
💡 Nanoleaf Elements Lights - amzn.to/3umwJVW
🎙 Blue Spark Microphone - amzn.to/3qgtYkq
🎙 Blue Pop Filter - amzn.to/3jEWM3r
🤳 Rode Microphone Arm - amzn.to/2Z68AlE
🎧 Sony MDR7306 Headphones - amzn.to/372jxta
📲 Stream Deck - amzn.to/373Uk1n
🖱 MX Master 2S Mouse - amzn.to/3d7J2gj
⌨️ Tecware Phantom Keyboard - amzn.to/3aUP4y9
Using links I provide I may receive a commission if you buy something which helps support the channel.
#donet #dotnetaspire #visualstudio #aspnetcore #aspire #rediscache #postresql

Пікірлер: 24

  • @MrSikesben
    @MrSikesben2 ай бұрын

    Thanks James for this video, let me try it out this weekend.

  • @Ador-25
    @Ador-252 ай бұрын

    good one

  • @timur2887
    @timur2887Ай бұрын

    xlnt!

  • @jportugal100
    @jportugal100Ай бұрын

    How do we more use the cache in a service?

  • @minatharwat1
    @minatharwat12 ай бұрын

    Thanks James, what Nuget package do you recommend for Push Notifications in .Net Maui?

  • @JamesMontemagno

    @JamesMontemagno

    2 ай бұрын

    shiny

  • @tonystevens2611
    @tonystevens26112 ай бұрын

    Hi James, I tried it and I'm getting "There is a problem loading our products. Please try again later."? How do you create the database and tables?

  • @JamesMontemagno

    @JamesMontemagno

    2 ай бұрын

    I have the context create it: github.com/jamesmontemagno/eShopLiteOnAspire/blob/master/Products/Data/ProductDataContext.cs Of course you can also do a migration as well.

  • @rodrigo-5967

    @rodrigo-5967

    2 ай бұрын

    @@JamesMontemagno but where do you ensure the table is created (productsdb)? The only thing I have to say is that AddDatabase in the AppHost is misleading to say the least... Anyway, other than that great video! :)

  • @mikelorengo8548

    @mikelorengo8548

    Ай бұрын

    ​@@rodrigo-5967Look at line 18 in the file he referenced.

  • @toragodzen
    @toragodzenАй бұрын

    How it works without Connection Strings ? You don't have any connection strings in configuration.json and it still works somehow ...

  • @JamesMontemagno

    @JamesMontemagno

    Ай бұрын

    aspire creates and configures the connection strings for you automatically

  • @JoshWeeks
    @JoshWeeks2 ай бұрын

    I heard tell of an Aspire discord but haven't been able to get a working link. Do you happen to know about that? I have burning questions.

  • @JamesMontemagno

    @JamesMontemagno

    2 ай бұрын

    Yes! It is a channel here: aka.ms/dotnet-discord

  • @JoshWeeks

    @JoshWeeks

    2 ай бұрын

    @@JamesMontemagno my man!

  • @rossimac
    @rossimac2 ай бұрын

    Your EnsureDatabaseExists logic seems to run after Postgres is online, but mine seems to run sooner than that and the database has yet to be fully turned on. Weird. I'm on a 32Gb Macbook M1 Max, so I don't think it's that my system is slow or anything. Any ideas other than adding in a delay? Maybe retry numerous times and then giving up?

  • @JamesMontemagno

    @JamesMontemagno

    2 ай бұрын

    Checkout: github.com/davidfowl/WaitForDependenciesAspire

  • @rossimac

    @rossimac

    2 ай бұрын

    @@JamesMontemagno nice find. I feel like this should be front and centre in Aspire.

  • @kristianmasar1532
    @kristianmasar15322 ай бұрын

    Every time I run my application Aspire create new docker container with DB on random port. If I cancel my application, that container with DB disappear. And this all the time, I think thats normal for Aspire. But when I fill database with some data thru app, I lost it because all the time I have new database. And I didnt find any solution for this.

  • @JamesMontemagno

    @JamesMontemagno

    2 ай бұрын

    It should all be the same database. Hard to know without a sample but inquire on the discord maybe

  • @kristianmasar1532

    @kristianmasar1532

    2 ай бұрын

    @@JamesMontemagno when you run Aspire app it create container for database. When you turn off your app, that database cointainer is gone and your data too. You have to create volume to database. Please can you show how to do it. I did it by the documentation and it doenst work how it should. Storing data persist

Келесі