Well done. I enjoyed listening to your rationale about how & why. Looking forward to the next installments. Go Blazor!
@Codewrinkles
4 жыл бұрын
Thank you very much.
@darenbaker4569
4 жыл бұрын
My thanks for this as you start to enjoy develop blazor apps to see some more advanced concepts has opened my eyes on different methods to achieve the same goals
@Codewrinkles
4 жыл бұрын
Great to hear!
@crumbdav
4 жыл бұрын
Is there a reason you use an Character[ ] vs IEnumerable ?
@hokoder7371
4 жыл бұрын
The razor.cs file reminds me of the code behind of WPF. Thanks.
@Codewrinkles
4 жыл бұрын
There are, for sure, a lot of similarities with WPF, especially in the server-side hosting model.
@satish8299
2 жыл бұрын
Character your choice is to put it close to the Razor component, is that more handy then put Character in a ModelView or a model? And alsoe the Response Model should be in a Shared folder Models ? And should you not put the actual GetHttprequest in a DataService class and inject that dataservice class in the Razor page/component?
@Codewrinkles
2 жыл бұрын
I think we sometimes we stick too much to different naming patterns and we don't concentrate enough on the conceptual choices that those naming patterns define. "Character" can be a "model" if it's something that belongs to our business knowledge. Also "Character" can be a simple POCO class it doesn't belong to our core business logic and as it is used to map a response from an external API. However, that's not important in this video, as we have a total different focus: splitting markup and C# logic into different files and organizing the project around features (like everybody does in Angular and React for years. This is even a best practice mentioned in the Angular Guide). Regarding the data service, sure you are right, but for that we have a separate video. I even mentioned in this video that you would usually put the logic for getting data in a data service.
@Tamer_Ali
Жыл бұрын
Thanks Mr.Dan for your video. I hope you talk about Refresh JWT Token in API and how Blazor wasm app should detect if the token will expire and refresh it in the background.
@Codewrinkles
Жыл бұрын
Unfortunately, not. I mostly worked on Blazor Server projects. Blazor WASM is unfortunately a totally different beast. One thing that I do on this channel, I talk only about things that I have used, encountered, solved in real projects I was working on. I really don't want to be as other creators out there that seem to make videos on virtually everything.
@Tamer_Ali
Жыл бұрын
@@Codewrinkles thanks I appreciate that
@mohsentavakoli3238
3 жыл бұрын
How do you register an event like onClick event for this type of component?
@Codewrinkles
3 жыл бұрын
I'm not sure that I understand the question, but there is an onClick directive in Blazor where you can specify the method you want to call when that specific button or html element gets clicked. Something like this: @Model.UpVotesCount ...where Upvote is the name of the method in the code behind that will be triggered when the icon is clicked.
@Levonfly
2 жыл бұрын
U r creating transient http clint, which isn't right, bcoz http sockets still holding in OS after you use it
@Codewrinkles
2 жыл бұрын
The scope of this video is not to provide a best practice on how to use the HttpClient. If you are looking for that, there are plenty of videos on this channel that explain the sockets connection problem and best practices on how to do it right.
@DavidCoding452
3 жыл бұрын
Is it possible to do scoped css and scoped javarcript. So like how other javascript frameworks you can easy write css and javscruot that will only affect this component. Is that possible?
@whibdevconsultinginc6879
3 жыл бұрын
This is possible with .NET5 release due in Nov. Here's a link to sample: github.com/danroth27/BlazorNet5Samples
@Codewrinkles
3 жыл бұрын
We have also covered now these topics on the channel. CSS isolation: kzitem.info/news/bejne/x5yA236dnGaVm4o JS isolation: kzitem.info/news/bejne/x5iY1aCds52YnWk Lazy loading: kzitem.info/news/bejne/p6F5yJabo5eYd6Q Also take a look at component virtualization: kzitem.info/news/bejne/lKZ6m6Obo6Rqi6A In my opinion, these are the most important new feature in Blazor on .NET 5.
@DavidCoding452
3 жыл бұрын
@@Codewrinkles thank you very much. Great stuff!!!
@zimcoder
4 жыл бұрын
I think you should also do the injection of the Httpclient in the code file as well using the inject DataAnnotation
@Codewrinkles
4 жыл бұрын
You don't have to inject it twice. It's a partial class, so whatever you inject in one file, it will be injected in the other as well. But, yes, you can inject it using the [Inject] attribute also in the .cs file.
@TeunSegers
4 жыл бұрын
@@Codewrinkles I would prefer the inject attribute as I would consider the razor file to be mark-up only and the cs file to be contain the view logic. As an extra step would go full MVP and add a presenter and a model (I would consider the razor to be the view and your characters data contract comes close to being the model). That presenter should then be the only thing that gets the HTTP injected. The presenter would also be my main focus for unit testing.
@kyreehenry9202
10 ай бұрын
not to sound rude but, this video doesn't make any sense
Пікірлер: 24