Blazor WebAssembly : Using HttpClient in MVVM - EP09

preview_player
Показать описание
Hey Coders,
Please Like, Comment and Subscribe. It really helps :)

In this episode of Blazor webassembly episode, I am talking about why you can make #WebAPI calls using #HttpClient in #MVVM architecture.

Topics that we are going to over -
1. How to inject HttpClient in CSharp class
2. PutAsJsonAsync and GetFromJsonAsync
3. builder.Services.AddHttpClient

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

Awesone~~ EP07~EP09 is really good for me. Thanks!! I can understand the typical calling http procedures in client with MVVM pattern, dependency injection, Interface and httpclientfactory.

hongkyuchung
Автор

Loved the way you explained things, not just for Blazor but also for the OOPs concepts, along with demonstrations. It's really helpful for a beginner like me. 😊

viral_plays
Автор

Very good explanation of using HttpClient in WebAssembly. Most other videos illustrate using Blazor Server

lyndondoliveiro
Автор

could you teach us how to use repository pattern with HTTP client factory

lakshanmadubashika
Автор

So the constructor with injected fields is still going to be relevant even if the object instance was created using the parameterless constructor, like you did with the implicit operator? How does that work?

bezimienny
Автор

Hi, How we manage this view model if my API is returning list object? You have created one method LoadObject to fill all data in "this". How can we use list here?

ArunSingh-lqfn
Автор

When you do builder.Services.AddHtppClient<Interface, Implementation>(...) you mention "typed Client" and "IHttpClientFactory". What do you mean be "typed client"? Isn't just a regular HttpClient hc created for DI? How does it relate to the type parameter of Implementation? Is hc only available for that implementation class? And what role has IHttpClientFactory here? If only an HttpClient is provided, where is the factory class? After all in constructor injection we get an HttpClient and not an IHttpClientFactory. Thank you for your great videos!

wassollderscheiss
Автор

Nice tutorial for MVVM, I already use it but I have this problem with routing, how can I use/route to another page using MVVM? Thank you for answer! Have a great day!

ricoestalilla
Автор

Hi Fahad. I am working on a Shopping Cart application and I am using the MVVM architecture. I am using the Blazored nuget (LocalStorage) package to persist the cart item. I am getting an exception
Unhandled exception rendering component: Deserialization of interface types is not supported. Type How do I handle this? Thanks Fahad. Other than this the application works fine.

peteroganwu
Автор

Thank you so much for this tutorial!
When I replace builder.Services.AddSingleton<IProfileViewModel, ProfileViewModel>(); with builder.Services.AddHttpClient<IProfileViewModel, ProfileViewModel>
("BlazingChatClient", client => client.BaseAddress = new it does not work anymore. When I start the Application I get an Error in the Browser. Do you have any idea, what the problem could be?

mariusbechtold
Автор

Dear Fahad,
How are you, I hope you are doing well and you and your family in a good health.
We missed you so much, so could you please kindly continue this series if you do not mind.
Thank you so much.

talkathiriify
Автор

Hi Fahad hope all is well? It's been 2 weeks.

peteroganwu