.NET 9 Changes The Way You're Using Dependency Injection with Blazor Forever 🔥

preview_player
Показать описание
---

Рекомендации по теме
Комментарии
Автор

that's really interesting, and it standardize dependency injection in Blazor comparing with the rest of .NET ecosystem.

xaberue
Автор

You can also use constructor injection in the ".razor" file not only in ".razor.cs" file.

bartlomiejuminski
Автор

I hope this is the right place for this. I recently watched your Dapper v EF Core video. Do you have a video, either on your channel or in the academy, that shows using both in a more real-world scenario?

davidmorello
Автор

Can you use the new class level constructor in c# to avoid having to create the constructor and private variable. E.g.: class Home (IMyService MyService)?

renynzea
Автор

This is great. Back to good old DI with naming that starts with _ for global variable for that class/page. The Pascal naming for variables always threw me of a bit.

CRBarchager
Автор

Funny to see the syntax highlighting issue show up - this has been a *huge* pain for me when working with Blazor.

oliverharvey
Автор

Same coder for request keyedservices ?

Totti
Автор

Hi Patrick, first thank you.
can you please explain why this approach is better than the [inject]-approach ?

heda
Автор

Is it worth it to change my .net 6 API to use identity's resources on .net 8? Or this difference isnt that big?

SteamF-nfts
Автор

Hello Patrick. Thank yor for this video.

mehmetyirtici
Автор

Hey Patrick, is it worth to change my .net 6 api to use the identity resources on .net 8? Or isnt that difference that big?

SteamF-nfts
Автор

I kinda perfer using [Inject] as it makes the code a bit tidier. If one rely on a lot of services, the constructor args can get quite long and messy.

OeHomestead
Автор

How can we mock a dependency which is injected through attribute. Since the class members would have to be protected or public for mocking it. Isn't that against OOP Principles?

iyerpram
Автор

Does this resolved as scoped, transient or singleton service?

bloggrammer
Автор

I liked more with the Inject attribute, cleaner, less code, straight forward

RockoShaw
Автор

would you recommend blazor or django for fast development?

bramburn
Автор

Don’t know why anyone would want to do this - @inject seems perfect to me.

oliverharvey
Автор

So what happened to the global injection file 🤨?

Oh and that's probably my one complaint about Blazor, those darn mysterious red squigglys for no apparent reason 🤷🤣

adrianspikes
Автор

I actually find constructor inyection pretty unreadable so I don't think I'll start using it in blazor if they give me the choice.

Heas_Heartfire