Тёмный

Intro to Blazor Server Side - Includes SQL Data Access and Best Practices 

IAmTimCorey
Подписаться 421 тыс.
Просмотров 332 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 845   
@nathangreene2626
@nathangreene2626 4 года назад
I listen at 0.5 speed because I like learning Blazor from a drunk guy
@IAmTimCorey
@IAmTimCorey 4 года назад
lol
@Chepaco25000
@Chepaco25000 3 года назад
I just did it lool
@RmjChathuranga
@RmjChathuranga 3 года назад
omg.. That worked for me too . lol
@saethnono
@saethnono 3 года назад
😂
@jeremyvnc
@jeremyvnc 3 года назад
Lol, I'm crying right now...
@andywalter7426
@andywalter7426 4 года назад
The good news is several days ago, I went through the course for hotel app and actually reworked it where instead of using razor pages, i used blazor and instead of having 2 pages for searching for rooms, it was all one page and worked great and even allowed where it can still choose easily between sql server or sqlite as well.
@IAmTimCorey
@IAmTimCorey 4 года назад
Awesome!
@harryperales
@harryperales 4 года назад
would you mind sharing the code, would love to have more resources i can use for study.
@andywalter7426
@andywalter7426 4 года назад
@@harryperales I would not mind. Not sure if i am allowed to send zip files here. If I can, then I will go ahead and do it. The only thing you will have to change is the path to a configuration file or implement the interface and choose new location plus new new implementation as well.
@ahkkafi
@ahkkafi 3 года назад
Great content tim
@IAmTimCorey
@IAmTimCorey 3 года назад
Thanks!
@DhirenNaik
@DhirenNaik 4 года назад
very useful video. thanks
@IAmTimCorey
@IAmTimCorey 4 года назад
You are welcome.
@zoltan.halasz
@zoltan.halasz 4 года назад
Thanks for the tutorial!
@IAmTimCorey
@IAmTimCorey 4 года назад
You are welcome.
@Clerid83
@Clerid83 3 года назад
Great tutorial! Any guidance on deploying this type of application in IIS? Having a bit of trouble and there’s very little information out there to assist
@IAmTimCorey
@IAmTimCorey 3 года назад
I don't believe I've covered that on RU-vid, but I did in the Blazor Server In Depth course (as one of multiple deployment options): www.iamtimcorey.com/p/blazor-server-in-depth Basically, you do the publish in the project itself and you either deploy directly to IIS or you deploy to a folder and then copy all of the files over to the correct folder in IIS.
@Clerid83
@Clerid83 3 года назад
@@IAmTimCorey thanks so much I'll check out that course and try it out!
@visitors2198
@visitors2198 3 года назад
Hi! Blazer looks nice, but what if I need to do something like dynamic input fields where I use jquery for adding and removing html content. How flexible is blazor comparing to MVC razor? What could be situations where I would want to use a Blazor server?
@MrOboltys
@MrOboltys 4 года назад
Hi Tim, It's a really great tutorial, thank you. I think it the best step-by-step guide that I've watched before. I looked through your solution and I just wonder how can I use IEnumerable instead of List? Because when I tried to convert it into the IEnumerable I received the error code that I was not able to solve
@IAmTimCorey
@IAmTimCorey 4 года назад
I convert the IEnumerable to a list in order to have the additional features of a list (a List is a type of IEnumerable already). Converting it back is just a matter of calling it that (assigning it to an IEnumerable variable) but in doing so, you lose functionality. You don't gain any.
@MrOboltys
@MrOboltys 4 года назад
​@@IAmTimCorey Thank you, now I got why you did it that way. Maybe I missed but do you have any guide on how to add an additional task for updating values in a row?
@hardus16
@hardus16 3 года назад
Any idea why I get this error on run system.AggregateException:'some services are unable to be constructed (error while validating the service descriptor 'servicetype: DataAccessLibrary.IEmployeeData lifetime: transient... It keeps going.
@hardus16
@hardus16 3 года назад
I named mine employee instead of people. It's the database I've created for myself
@BernardPhua
@BernardPhua 4 года назад
Thanks TIm for the great introduction to Blazor. I have tried many times to click on the link to get the source code by filling up my Name and email address. But till date I still didn't receive the source code. Is there anything wrong?
@IAmTimCorey
@IAmTimCorey 4 года назад
Your email system may be filtering out the emails. I'm working on a long-term fix. In the meantime, email me at tim@iamtimcorey.com and I'll send the file to you. Just make sure you specify which video you are looking for source code from.
@buddyrowe7460
@buddyrowe7460 Год назад
With Blazor, can you eliminate the need for JavaScript code altogether, will they be edge cases if you do, would it be going against what Blazor is trying to do? How do you mix JavaScript with page if possible and ok?
@IAmTimCorey
@IAmTimCorey Год назад
You won't eliminate the need for JavaScript in all cases. You will just greatly reduce the need. Blazor integrates well with JavaScript.
@buddyrowe7460
@buddyrowe7460 Год назад
@@IAmTimCorey is jQuery still alive, because I read somewhere that reactjs and angular has replaced it. It seems like jQuery would work with Blazor for UI effects like drag and dropping rows, or highlighting rows and columns, etc.
@user-yr1uq1qe6y
@user-yr1uq1qe6y Год назад
@@buddyrowe7460it’s not as popular but still valid for things like this and maintained. As long as you make sure the DOM has been initialized before attaching jQuery event handlers and functions it should be fine!
@psychoclips6817
@psychoclips6817 4 года назад
why can i not find a blazor client side video?
@IAmTimCorey
@IAmTimCorey 4 года назад
The reason why is because Blazor Client Side is not out yet. It is still in Preview. It should be out in May. In the meantime, I do have two videos on the topic (they are for specific previews though): ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CaxR4_fP-FA.html and ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1-9dXoGl0Cg.html Watch them in order because the second one fixes the first one (there was a breaking change in the previews). More Blazor Client Side will be coming as it gets closer to release.
@jiribatulka49
@jiribatulka49 4 года назад
"MinLength for the FirstName is 5" - a guy named Tim
@IAmTimCorey
@IAmTimCorey 4 года назад
lol
@oncalldev
@oncalldev 4 года назад
Great introduction to Blazor Server-Side and one of the best "how-to" programming tutorials I've watched - clear, understandable and to the point.
@IAmTimCorey
@IAmTimCorey 4 года назад
Thank you!
@paulnewell8873
@paulnewell8873 4 года назад
Tim, thank you so much for this, your tutorial is so clear and concise. I haven't programmed in about 5 years and just getting back into it and coming from a VB desktop application background it was a bit daunting. This tutorial and your c# to SQL tutorial made things so easy to understand. Easily the best tutorials around. Cheers.
@IAmTimCorey
@IAmTimCorey 4 года назад
Excellent! I am glad it was so helpful.
@leighhydes
@leighhydes 4 года назад
Awesome introduction to Blazor. I must also admit that this is one of the few video tutorials I've been fully engage with all of the way through. Thank you.
@IAmTimCorey
@IAmTimCorey 4 года назад
Great to hear!
@alansimpson4245
@alansimpson4245 4 года назад
Thanks Tim, great as always. For anyone who is interested, I did a Blazor / Dapper playlist. I won't post the URL because last time I did this message didn't show. But if you search Google for Blazor Dapper CRUD you should find it under Alan Simpson. Not saying it's as good as what Tim does, he's my mentor too. But it may be worth a peek if you're interested in Dapper.
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks for sharing.
@markharby180
@markharby180 4 года назад
This is by far the best 'real-world' Blazor tutorial I have seen. Great work Tim. Will you be doing a client-side video as we get closer to launch ?
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks! And yes, I will.
@RalfsBalodis
@RalfsBalodis 3 года назад
0:00 - Intro 1:22 - Creating new Blazor Server App 4:46 - Balzor Server App overview 11:08 - Counter page explained 18:15 - Counter Page Network traffic 25:00 - Fetch Data page explained 32:24 - Data Access 32:55 - Data Access: Standard Class Library with Dapper 46:59 - Data Access: Blazor App configuration and database connection string 49:02 - Data Access: New Razor Component page and display Data from database 59:30 - Data Access: Save data with data validation 1:03:52 - Data Access: Blazor UI from 1:08:25 - Data Access: Save data from form 1:13:36 - Summary and concluding remarks
@IAmTimCorey
@IAmTimCorey 3 года назад
Thank you kind sir!
@tmhchacham
@tmhchacham Год назад
@@IAmTimCorey typo: Balzor
@MrDbodenheimer
@MrDbodenheimer 3 года назад
Tim, Thank you so much for your tutorial! I'm about halfway through but I've run into what I assume to be a nubee issue. When I create the class AqlDataAccess, I'm able to type in the Iconfiguration, but then when I press Ctrl ., i get a small window saying Change signatures. I'm sure it's something to do with how I have Visual studio set up. Any suggestions?
@cjforkyfork8578
@cjforkyfork8578 3 года назад
I'm having the same issues, was it the way you had Visual Studio setup?
@StephenSamuelsen
@StephenSamuelsen 4 года назад
Phenomenal tutorial! Learned a ton watching this. Thanks for the great upload!
@IAmTimCorey
@IAmTimCorey 4 года назад
Thank you!
@randyriegel8553
@randyriegel8553 4 года назад
Thanks Tim. I've been messing with Blazor for a while (back in the preview versions) and never had very good experiences with it partly because lots of stuff changed from each preview release. This video was awesome and I learned a LOT! I've been using C# for about 10 years and still watch some of your fundamental videos and still learn stuff. Keep up the good work. I plan on subscribing to your Patreon.
@IAmTimCorey
@IAmTimCorey 4 года назад
I'm glad my content has been so helpful.
@BCLBlazorCollectionsLibrary
@BCLBlazorCollectionsLibrary 4 года назад
Really sir, very good structural info you describe in this video :)
@IAmTimCorey
@IAmTimCorey 4 года назад
Thank you!
@calx
@calx Год назад
I've done half a dozen of these Blazor CRUD tutorials, and this is the first one that was clearly explained and "just enough" to get me through these early stages of learning. Thank you so much!
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@PeterMisovicProfile
@PeterMisovicProfile Год назад
Exactly!
@sunilanthony17
@sunilanthony17 4 года назад
This is an awesome introduction to Blazor. Thank you for the pet talk at the end. This is really a game-changer for me because I'm better at C# than JavaScript. My pet peeve is that MS name the extension .razor. Why not blazor to avoid confusion?
@IAmTimCorey
@IAmTimCorey 4 года назад
I think they reused items but I agree.
@sausagesmcgee7079
@sausagesmcgee7079 3 года назад
this guy is a fantastic teacher - subscribed! - I had ran up the demo project and thought I had it figured Tim showed many great tricks and explanations - Thanks Tim!
@narcolic832
@narcolic832 4 года назад
Great video Tim! Do you plan on making a video for a client side blazor app? (Now that webassembly is production ready)
@IAmTimCorey
@IAmTimCorey 4 года назад
I do, and very soon.
@kainpwnsu
@kainpwnsu Год назад
TIM! Thank you! THIS IS HOW CLASSES ARE SUPPOSED TO BE TAUGHT! You have explained WHAT, WHY, and HOW. Most courses only explain what to do. Standing ovation. You are an EDUCATOR. You've got yourself a new subscriber. I also very much appreciate the throwback to the "under construction" GIF of the 90s, at 27:25. Ah, those were the days, hacking out HTML between college classes so I don't completely starve to death.
@IAmTimCorey
@IAmTimCorey Год назад
I'm glad you enjoyed it.
@AthelstanEngland
@AthelstanEngland Год назад
​@@IAmTimCorey agreed excellent video again. Tim, is this still relevant as a good foundation for someone just getting ready for first Blazor app, or should we be looking at another/extra video. Thanks.
@zarokoshin4090
@zarokoshin4090 3 года назад
I love the idea of making this kind of web apps without the need for JavaScript 🤩. There’re some topics that i find complicated and wrap my head around but you have a way to explain things that makes it like it’s simple, to me that’s a Great Teacher as always... thanks Tim, you are the best !
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
Thank you for sharing.
@pylvr8021
@pylvr8021 4 года назад
3 things i do before whatching Tim's tutorial. - Disable Adblock - Put like -Thanks comment
@piranha1337
@piranha1337 4 года назад
Or get the $1 tier on patreon and keep AdBlock on.
@IAmTimCorey
@IAmTimCorey 4 года назад
Most appreciated.
@ElCidPhysics90
@ElCidPhysics90 2 года назад
I normally have three projects for my applications that have database access: My main project, a DataModel layer for the models, and a DataAccess layer that provides access to the database. I noticed you combined the DM and DA into one project. Would this be ok in a production application, mine are all internal projects, nothing commercial? I kinda like the idea of have that piece in one project.
@moneyfresher3035
@moneyfresher3035 3 года назад
Excellent tutorial Tim. As you suggested, learning Blazor now. its too good. Do you have any example of consuming REST API in Blazor app.? In this tutorial Dapper is used. It would be great if you can show how to use REST API to get and set data.
@IAmTimCorey
@IAmTimCorey 3 года назад
I show how to consume an API in my Blazor WebAssembly demo in the Getting Started with ASP.NET Core course: www.iamtimcorey.com/p/getting-started-with-aspnetcore
@rubenssz
@rubenssz 4 года назад
You sir help this world become a better place. I appreciate your effort. Thank you for this lesson, and for helping us!
@IAmTimCorey
@IAmTimCorey 4 года назад
You are welcome.
@programthis3805
@programthis3805 4 года назад
***You need SQL Server to run this**** I found a solution if you cannot use SQL Server Replace using System.Data.SqlClient; with using MySql.Data.MySqlClient; use : using (IDbConnection connection = new MySqlConnection(connectionString)) You're welcome :D
@IAmTimCorey
@IAmTimCorey 4 года назад
Thanks for sharing (an upcoming video will be covering this).
@programthis3805
@programthis3805 4 года назад
@@IAmTimCorey awesome thank you...I was banging my head trying to figure this out lol
@programthis3805
@programthis3805 4 года назад
@@IAmTimCorey would you mind pinning this to the top please for others and for future reference?
@pylyppylyp1335
@pylyppylyp1335 4 года назад
Thanks for the video!. One question. I use render-mode="ServerPrerendered" In this case component calls OnInirializedAsync twice! What is the best workaround here? I have to load a big amount of data on page load. Thanks!
@IAmTimCorey
@IAmTimCorey 4 года назад
Interesting. I've not seen that. I'll have to check into it for my next video.
@pylyppylyp1335
@pylyppylyp1335 4 года назад
IAmTimCorey Thanks! Will wait for your next video.
@20alp02
@20alp02 2 года назад
Thank you so much! Awesome tutorial!
@IAmTimCorey
@IAmTimCorey 2 года назад
You are welcome.
@davidpccode
@davidpccode Год назад
hi Tim. Thanks for your great content. We are about to choose Blazor in our company and we plan to take your courses of course to learn Blazor Server. But a key question arises for us to decide on this technology. We appreciate if you can help us. If my application works with Docker, once rollingupdate is done and the old containers die and new ones are created, what happens to those persistent client connections? everyone lose connection?
@IAmTimCorey
@IAmTimCorey Год назад
Yes, if you close down a connection, people will lose that connection. You could use a service like Azure SignalR to possibly mitigate that issue, though.
@davidpccode
@davidpccode Год назад
@@IAmTimCorey Thanks a lot. Let's think that we are orchestrating with Kubernetes or Swarm or whatever, and we have 20 containers of the same app. So, let's assume that there is always a container, before killing the old one the new one was already created and a load balancer always finds a container with my application. Even in that scenario, would the clients lose connection?
@davidpccode
@davidpccode Год назад
I see in several Github-Issues of the Blazor repository and of people who use blazor in production, explain this problem. In short, there is no solution. It's a shame because Blazor Server has a very powerful concept, but something as simple as updating my app requires killing all my users or doing weird sticky-session tricks or saving data to localstorage or automatically reloading the page, or using a service from Azure and if I don't use Azure but AWS? My guess, without being an expert on the subject, Blazor Server is not production ready. Even under certain variables, it is more viable to use WASM, which enables the traditional and scalable client-server model with a well-defined backend APIs . Tim, this would be an interesting topic for you to cover in a video. don't you think? Thank you for your time.
@golfnutt1969
@golfnutt1969 11 месяцев назад
How do you get the css and html intellisense in your Blazor components (.razor files)? I've been using Visual Studio 2019 and 2022 (currently at version 17.7.6) and I've never had intellisense for CSS or html.
@iandalrymple7255
@iandalrymple7255 2 года назад
Awesome video as always - I was going to dive into react but after watching this I am going to stick with Blazor based on the comments at the very end about spreading your brain too thin (paraphrase). I do embedded and also lots of data science stuff so am already packed pretty full. Thank you sir, for the video.
@IAmTimCorey
@IAmTimCorey 2 года назад
You are welcome.
@1xXNimrodXx1
@1xXNimrodXx1 3 года назад
Thank you very much for this post. If I were to edit the data directly over the database, would the frontend get the alteration of data without refreshing ?
@HackelSchorsch
@HackelSchorsch 3 года назад
Anyone else get a conflict between different Microsoft.Extensions.Configuration.Abstractons ? I have version 5.0.0 only installed.
@embaayyub7289
@embaayyub7289 4 года назад
Thanks, Tim, for amazing tutorials. I am waiting for a video about blazor globalization(localization) in client and server-side included data annotations. I hope you will do it.
@IAmTimCorey
@IAmTimCorey 4 года назад
I will add it to the list. Thanks for the suggestion.
@DLVideo94
@DLVideo94 4 года назад
@@IAmTimCorey I will love that too. A video about blazor globalization(localization)
@emmaelesbohlin3063
@emmaelesbohlin3063 Год назад
Thank you!! I had one problem; when I copied the connection string from the database I had to remove some spaces to make it work; my connection string said "Trust Server Certificate" instead of "TrustServerCertificate". Took a couple of hours to figure out what the problem was haha... what's that about?
@Mohammad.AlShaabi
@Mohammad.AlShaabi 2 года назад
what courses of yours that I can learn from to understand the concept behind DataAccessLibrary, ISqlDataAcess, IPeoeData, services?
@Nullfighter
@Nullfighter 2 года назад
Tim, my GET from the db works as intended, but my form won't validate or call my submit event. I am using OnValidSubmit with the proper annotations and everything just as you typed. But pressing submit just refreshes the page.
@martinciaffone2352
@martinciaffone2352 3 года назад
Hi, I have two doubts so far: 26:00 What is the advantage, if is it there one, on having: @inject WeatherForecastService ForecastService, instead of this inside @code: private WeatherForecastService ForecastService = new WeatherForecastService(); 27:27 I added some heavy delay on the GetForecastAsync() but I did not see the Loading… label appears on-screen… Thank you all, and special thanks to the author @IAmTimCorey
@khalidabarou9478
@khalidabarou9478 3 года назад
hi @IAmTimCorey, thanks for your video, very usefull!!! but how can i do the same, i mean get people the way you teach us here but not from the razor component but from a .cs file? it seems very complex ... :-(
@hawnyawk1
@hawnyawk1 4 года назад
Thanks for the video Tim, seems like with Blazor, the MVC "Controller" code is now on the pages? Which is good and bad, kind of liked having everything separated. Does this mean there is no need for Action commands like [HttpPut], [HttpPost] anymore? Did not like that stuff anyway, if it's gone, good.
@IAmTimCorey
@IAmTimCorey 4 года назад
It is similar and someone did mention in the comments that you can create a separate file for the code. I'm going to be trying that soon. As for the HTTP verbs, you don't need those because you are communicating via an open SignalR web socket.
@queenstownswords
@queenstownswords 4 года назад
@Tim Thanks for pointing out the path vs. blazor component 'disconnect' (at the 50 minute mark of the video for others)! That disconnect is exactly what gets people confused in the real world. So cheers and please keep up the great work.
@IAmTimCorey
@IAmTimCorey 4 года назад
You are most welcome.
@xibajezc
@xibajezc 3 года назад
How the binding works is intriguing to me... The UI gets rerendered as soon as the razor page model's member is modified (new person element added)?
@dougp7525
@dougp7525 3 года назад
Your tutorial helped quite a bit in developing my first web app which used sql server express. My plan is to host it on a in house server but I am not sure of how to do this. I have tried to publish to IIS manager locally however it does not find my database using the same connection. Do you have any tutorials geared towards that! Thanks, you've been a great help
@IAmTimCorey
@IAmTimCorey 3 года назад
No, not part of my focus areas.
@farsidesc4044
@farsidesc4044 4 года назад
Thanks for this series, Tim! I not only followed this entire video, but I also purchased your course on Blazor Serverside! It's been instrumental in helping increase my scope of capability in DevOps! I do have a question that's been bothering me for quite a while... Do you know of any resources on bypassing the default login page and building your own? I'd like to create a custom one, and additionally not store the credentials using EFs SQLServer. I'd much rather handle that information in an Azure CosmosDB (it's fun and it's free!). Feel free to tell me how wrong I am, but I'd love to hear your take on this. Thanks!
@IAmTimCorey
@IAmTimCorey 4 года назад
The TimCo Retail Manager series uses the authentication in the API so that the WPF front-end can have a custom login page. That might be some of what you are looking for (or at least an example to work off of). As for not using EF, I would recommend looking at a different authentication/authorization product then. I don't recommend creating your own so look at Auth0, IdentityServer4, or similar.
@cashme6819
@cashme6819 3 года назад
blazor does have a code behind file if you want and i want add file name it the same ass the razor file and add ".cs" index.razor index.razor.cs and add the word "partial" for the class
@jdtracy
@jdtracy 4 года назад
Great content, I've subscribed. I was never heavily into MVC\Razor pages and never a big fan of .net programmers using Angular or any of those javascript framework for exactly the reasons you mention. We are just looking into Blazor for a new project and this is great news to me. Now I can have the benefits of those frameworks without having to spend all the time. Any updates for 3.1?
@IAmTimCorey
@IAmTimCorey 4 года назад
Glad to help! No updates
@loganparker9923
@loganparker9923 4 года назад
Hi Tim, Thanks for the tutorial! Quick question, How would I go about accessing the Id of a row in a table for linking two tables together? Thanks
@IAmTimCorey
@IAmTimCorey 4 года назад
The Id is just one of the columns so you would access it like any other column.
@spyofborg
@spyofborg 4 года назад
in a real live production application, how would you create the layers, I know you have the UI layer, and you also used the Data access layer, in your demo, what would you, for example, move to a business layer? I read some people say to move the actual queries to the BL and from there access the DAL.
@IAmTimCorey
@IAmTimCorey 4 года назад
Layers are interesting. In general, you are correct in your assertions (and what you read). However, it isn't always as clean as that. Do your best to create an application that is easy to maintain and upgrade over time. That typically starts with the three layers, but it doesn't always get stuck there. Worry less about following a specific architecture and more about making the best application you can. The SOLID principles will help: ru-vid.com/group/PLLWMQd6PeGY3ob0Ga6vn1czFZfW6e-FLr
@gavranhas
@gavranhas 2 года назад
Thanks a lot, Tim! That was EXACTLY what I was looking for to get started with an app. I wish you all the best and, of course, you have another pupil for a long time. :) Thanks again.
@IAmTimCorey
@IAmTimCorey 2 года назад
Glad it was helpful!
@EliCarter
@EliCarter Год назад
I am haven't coding since ASP Classic and I was huge into building applications back then. This is the best video I found so far for working with Dbs. Thank you. I have a long road ahead.
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@ismailbayram7063
@ismailbayram7063 3 года назад
hello my blazor webassembly project is on linux I want to publish can you help me
@abdullaalblooshi2406
@abdullaalblooshi2406 4 года назад
Very helpful and valuable as always. As Blazor is using signalr, it would be great if you can explain how to do realtime notifications. Say you receive a notification when a customer makes a new order, or a manager receives a notification that he has a pending job according to a certain workflow.
@IAmTimCorey
@IAmTimCorey 4 года назад
I will add it to the list. Thanks for the suggestion.
@shararehbanei3871
@shararehbanei3871 Год назад
since I started as "Junior Developer" ,you're my Great Teacher ,Many Thanks Tim 🙂
@IAmTimCorey
@IAmTimCorey Год назад
You are welcome.
@kareemsakr41
@kareemsakr41 4 года назад
One of the reasons i always shied away from .NET and C# is how hard it was to find good resources on it especially if you compare it to React for example. This is the first channel i come across that is actually making me feel excited about .NET
@IAmTimCorey
@IAmTimCorey 4 года назад
Awesome! I'm glad.
@AlexKruddinger
@AlexKruddinger 4 года назад
Ima wathing thes for second time - a lot of good structured information, well done!
@IAmTimCorey
@IAmTimCorey 4 года назад
Thank you!
@jaiveerlaghari116
@jaiveerlaghari116 4 года назад
34:42. Thanks for the great video! I'm a newbie and it helped me quickly start understanding the concepts. I'm using VS 2019 and tried to follow your directions (CTRL+.) to install the package microsoft.extensions.abstrations but not getting the option am I missing some steps to have my IDE ability to install the package with CTRL+. shortcut?
@IAmTimCorey
@IAmTimCorey 4 года назад
Make sure your cursor was on the correct location. It may also have the cache updated with that information. Add the NuGet package manually and then the Ctrl+. should work.
@cjforkyfork8578
@cjforkyfork8578 3 года назад
@@IAmTimCorey Not quite sure how active you are in checking the comments of old videos but it's worth to ask, however how would one go about adding it manually? I checked my Dependencies and saw that I have Dapper added to my DataAccessLibrary. Also im completely new to blazor, great video.
@Darbokst
@Darbokst 2 года назад
does your timco retail manager talk about adding pagination and filtering to the database form?
@ianjeffery3762
@ianjeffery3762 4 года назад
Please do more Blazor videos! The two you have done so far is great.....but i want more :-)
@IAmTimCorey
@IAmTimCorey 4 года назад
They are coming, including a start to finish course that uses them.
@Dhurgan
@Dhurgan 2 года назад
Now, I love these coding examples you did, but I am using VS 2022 now and the templates dont quite match up anymore :) I am sure the source will work fine in 2022 as well, but I will try to build it in the new way which I guess is more like the Minimal API way. Doing my best ;) New at this :)
@IAmTimCorey
@IAmTimCorey 2 года назад
The biggest change is the removal of Startup.cs. I covered those changes here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vdhFw1VSowg.html
@Dhurgan
@Dhurgan 2 года назад
@@IAmTimCorey Yes, I watched that one as well :) I am new to DotNET and C#, but my job has brought me from the Unix world over to the Windows platform and DotNET, and when I found Blazor I decided to go all in on that to complement the things that I do for the place I work with new frontend pages for some tasks that has been difficult to get in to the new product we use. As, f.ex. simple table management for non technical end users. This is leading me in the right direction :)
@ritzP1976
@ritzP1976 3 года назад
Overall your content is brilliant. Definitely a must for all newcomers to the technologies you discuss.👍🏾
@IAmTimCorey
@IAmTimCorey 3 года назад
Thanks!
@KenVillines
@KenVillines 4 года назад
Tim, Great video!! Do you have a video explaining how DI for IConfiguration works in your DataAccess Class? I am missing the piece where we tell the runtime to grab the IConfiguration from the appsettings and inject it into the ctor...... That being said, I am guessing the AddTransient() actually interrogates types and grabs the IConfiguration dependency when the ctor gets called?
@IAmTimCorey
@IAmTimCorey 4 года назад
IConfiguration is already added by default to dependency injection (see this video for more info: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_2_qksdQKCE.html ). So when DI goes to construct the data access class, it sees that the constructor takes in an IConfiguration object, it looks in the DI container to see if there is an item that matches that request. There is so it injects the value into the constructor. I will be going into more depth on dependency injection in .NET Core at some point.
@KenVillines
@KenVillines 4 года назад
@@IAmTimCorey Thanks for the thorough answer!! I thought it was something like "built-in already .... you get it for free". I have used Ninject in the past (4 years ago) and you pretty much had to configure it all. This new DI in Core looks really nice...I will watch the video you have on DI :)
@WillEhrendreich
@WillEhrendreich 3 года назад
Hey Tim, and hello to the rest of you fine developer people! I'm getting an absolutely TERRRIBLE memory leak in my blazor app. I got up to the part right before where you started to input data, I got curious about how I'd use different data sources. I went with using EFCore 6, loading a huge table of 23k entries, and then when I go away from the page, then back again, the original page data never gets garbage collected. The used memory just keeps on skyrocketing every time I reload the page. I did my due diligence and looked around on the interwebs for answers and got some ideas, but in using them I'm still stuck. I have my Dependency injection using the IDbContextFactory method as recommended for blazor, I'm using IDisposable on the page, directly calling dispose on my dbcontext, clearing my list of display models ... I don't know what else to do here. Is it because I have a Context created within the page at all? I get that it might be nice to have this abstracted, and I guess I should try that next, but that still doesn't explain why this data isn't getting garbage collected. Anyone else deal with this?
@IAmTimCorey
@IAmTimCorey 3 года назад
First, make sure you aren't in development mode. Development mode will have "memory leak" "issues" because it is preserving more data in memory for debugging. Next, are you sure it isn't being garbage collected? Sometimes, if a system doesn't need memory, the GC does not run (because the GC takes up processing power).
@WillEhrendreich
@WillEhrendreich 3 года назад
@@IAmTimCorey ok, I also saw while looking at the github, apparently it also holds on to the separate "circuits" for 3 mins or so after they are closed. I assume it's for.. connection stability issues? or something.. but anyway, that's still kind of an issue if I want to load big data sets in a page... I bet I'm just not caching it correctly.. anwyay, thank you for your help, as always Tim, you're so fantastic and your appreciated.
@RenaudMauduitRizzcandy
@RenaudMauduitRizzcandy Год назад
Got an error here on the U await for "," public async Task LoadData(string Sql, U parameters) Im using Visual Studio 2022 and there is no more startUP;cs now only program.cs. WHat about it please ?
@IAmTimCorey
@IAmTimCorey Год назад
Here you go: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vdhFw1VSowg.html
@cissemy
@cissemy Год назад
Hi Tim, How can return inserted ID ? Thanks
@SayWhaaaaaaaaaaaaaaaaaaaaaaat
@SayWhaaaaaaaaaaaaaaaaaaaaaaat 3 года назад
BAZILLION LIKES BECAUSE OF USE OF DAPPER!!!!! HATE WHEN PEOPLE USING THAT GARBAGE OVERSIZED ENTITY FRAMEWORK
@IAmTimCorey
@IAmTimCorey 3 года назад
😂Glad you enjoyed it.
@Gramr98
@Gramr98 2 года назад
47:45 Not sure if you're reading this since the video is kinda old, but if transient means that it will create an instance every time we ask for it, why would we want to make the SqlDataAccess-Service transient as well? Wouldn't it make more sense to make the SqlDataAccess Singleton like the WeatherForecastService to prevent concurrent accesses on the same sql table (here the People-Table) from multiple SqlDataAccess-Objects for example? Also for 53:38, if you press CTRL+K, then CTRL+D it will automatically indent the entire file corretly again without needing to get to the mouse and mark any text
@IAmTimCorey
@IAmTimCorey 2 года назад
It has been a while since I reviewed this code, but as long as the methods in the class do not store any data in the class and as long as the class itself does not store any state data, it would be fine to make it a Scoped (one instance per caller). I would probably avoid Singleton in the real world just in case someone ever updated the class to have any type of data storage. For instance, I've updated a class like that to have methods to create a transaction, where the transaction lived through more than one call. That would require a Transient, but if I forgot, a Scoped would at least prevent me from allowing data to cross security boundaries. Note, though, that having a Singleton would not prevent multiple calls to the same table. Yep, that formatting option is nice. I believe that it was not yet working properly for Blazor when I made this video, but I am not sure.
@designandprocess
@designandprocess 3 года назад
I was trying to use EF for CRUD operations on a big SQL database. It was excruciating, all the goofy linq stuff and context, it basically just created a hot mess. I know SQL so EF was stupid to use! I am able to use to the Models created from using the EF scaffolding, so next time I'll just create a project using EF create the models from the database then jump into Drapper where there's no hidden man behind the curtain! Thanks!!!
@IAmTimCorey
@IAmTimCorey 3 года назад
You are welcome.
@pauljackson3476
@pauljackson3476 Год назад
Very well laid out Tim. Love your videos! Question: "Ctrl + .' didnt work for me when modifying the Navlink class. Am I missing something?
@IAmTimCorey
@IAmTimCorey Год назад
That can be tricky when you have a mixed environment like that. It doesn't always work.
@Saveaaa
@Saveaaa 3 года назад
My question is a little off topic. Back to gRPC, front blazor. I spread it in docker on vps (ubuntu) - Cyrillic with questions in the table, the site itself in Russian is normally displayed. The data comes from gRPC just a hardcoded json serialized string. When I start from the studio, everything is fine. From docker to Windows too. I don't know what to do anymore ...
@IAmTimCorey
@IAmTimCorey 3 года назад
I’m not sure what you are asking. I don’t see a question.
@waynehawkins654
@waynehawkins654 2 года назад
Tim, I hope you can help. I have a BootStrap 5 template and have managed to make this work with a Blazor Server App. But if I try the same with a Blazor WebAssembly, all works to a point. The CSS, look and feel is corrected, but do you think it can run the javascrips. I have included and it see the script code, it just not running on a .razor webpage. Have you done any video on setting up a project like this with javascripts
@IAmTimCorey
@IAmTimCorey 2 года назад
It should be no different to run the JavaScript on a Blazor WebAssembly project vs a Blazor Server project.
@mentalstatement
@mentalstatement 2 года назад
I think the biggest advantage of Blazor Server is the ability to make single page apps without creating API's. I personally HATE web-development. I want to create web applications similar to desktop apps where you can just work with classes and not bother with API's. I think Microsoft has done a really poor job of advertising this feature. I think this is the main selling point of Blazor.. Blazor web assembly i really dont see the point of. I can do most of the stuff with javascript.
@IAmTimCorey
@IAmTimCorey 2 года назад
That is a nice feature of Blazor Server. As for Blazor WebAssembly, the benefit is that we can still use C# for our client-side SPA. That also includes the ability to make a progressive web application (PWA), have it work offline, and more.
@cubii8126
@cubii8126 2 года назад
Thank you for the tutorial ! can you make a video about CRUD which includes SQL in Blazor Server Side ?
@IAmTimCorey
@IAmTimCorey 2 года назад
Here is a video with full CRUD in Blazor Server using MySQL. The principles for SQL are exactly the same. You would change just a couple of lines of code to make this work with SQL: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-_JxC6EUxbDo.html Remember that SQL data access is the same regardless of the UI project that is calling it.
@SimpMcSimpy
@SimpMcSimpy 4 года назад
This is all cool etc., but there are so many problems I see with B. Server. One of which is protection against DDoS. In such case B.Server approach would work slow. UX experience would be terrible in such cases. IMO B.Server is not solving anything. Blazor Client on the other hand (and WebAssembly in general) is much better approach. You can serve you web application from a static web server and simply call web APIs you need directly from a client.
@IAmTimCorey
@IAmTimCorey 4 года назад
I am not sure how slowing down because of a DDoS attack is Blazor's fault. Any site that experiences a DDoS attack will slow down. That isn't a problem with the web server, that is a problem with the security systems that are designed to prevent DDoS attacks. Blazor can scale just like any other web application, so if you turned on scaling in Azure, for instance, it could weather the storm just like any other web application could. It would be no further crippled than any other site. In fact, Blazor WebAssembly would probably be worse off. First, the initial download is larger (about 2MB if you compress everything) so the initial hit from multiple sites would be much worse than Blazor Server. Second, Blazor WebAssembly uses an API for communication. API communications are "heavier" than SignalR so if your DDoS did include more than loading the page but actually navigating (doubtful) then again Blazor WebAssembly would be transmitting more data than Blazor Server so it would be theoretically in worse shape. As for Blazor Server not solving anything, it solves the largest issue on the web - how to have the benefits of server-side applications (code security, speed, etc.) and yet also have the benefits of client-side applications (data manipulation without full page refresh, state, etc.) That is an AMAZING set of benefits without major drawbacks (the tiny binary transfer of data between client and server is more efficient than an API call, like I said). Blazor WebAssembly is larger than Blazor Server and it requires maintaining an API in order to use it for data. It is a great technology and being able to be an offline PWA is a great option, but if you aren't looking for those two features, the safer, faster, and overall better option for web development is Blazor Server.
@jennaschrauwen
@jennaschrauwen 2 года назад
Hi, do you also have a video for editing a person to database?
@scottpollard3270
@scottpollard3270 Год назад
Sorry if i missed it, but how did the Connection String / Configuration get passed to the SqlDataAccess object?
@IAmTimCorey
@IAmTimCorey Год назад
We used dependency injection to pass the IConfiguration to the SqlDataAccess class (line 15 at 37:12). IConfiguration is built into ASP.NET Core by default.
@mov4736
@mov4736 2 года назад
How can I access DOM elements using blazor? for example: currently if I click the submit button twice quickly, it submits multiple times. I want to disable the button until the request is done.
@IAmTimCorey
@IAmTimCorey 2 года назад
You don't need the DOM for that - you can disable the button using the disabled flag or by adding a class that disables the button. Trigger that on click and don't re-enable it until the submit is complete.
@jamaludinalafghan6125
@jamaludinalafghan6125 3 года назад
Can you explain to me, whats procons using Blazor WebAssembly rather than BlazorServer ?
@IAmTimCorey
@IAmTimCorey 3 года назад
check out - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KOMo77bVKSw.html "Intro to Blazor WebAssembly and How It Is Different from Blazor Server"
@sohailamiri3239
@sohailamiri3239 2 года назад
Thanks for your great work. Why didn't you use EF for accessing data? Isn't EF better for two way data access than dapper?
@allthecommonsense
@allthecommonsense 2 года назад
EF is a cluster F
@binarysolution6685
@binarysolution6685 4 года назад
Blazor for me it wasn't secure , because you can steal code library from "xxx .com/_framework/blazor.boot.json" to download dll file , this made me very sad
@IAmTimCorey
@IAmTimCorey 4 года назад
That is a misconception. I am assuming you are talking about Blazor WebAssembly, where your code lives on the client. Yes, someone can get your DLL because it lives on the client, just like any desktop app. This is just the same as a JavaScript front-end framework like Angular, Vue, or React. All of that code lives on the client as well. That is why direct data access is not permitted in Blazor WebAssembly. If you don't like having that code exposed to the user (again, like a desktop app), you need to run Blazor Server. That also has some code that lives on the client, but it is a Microsoft library that facilitates the SignalR connection. None of your code lives on the client or goes to it. They just get the rendered pages. This is the difference between client-side web development and server-side web development. Both have their places. You just need to know what each does and why.
@AbdulAziz-xi1lo
@AbdulAziz-xi1lo 3 года назад
this is dynamic menu code I wann check if a main menu have some child items or not so I made a logic by counting can anyone help me please how can I call or any other way to achieve this --Code Block @code { int mnuCounter; void CountMenuItems() "this method" { mnuCounter += 1; } } --HTML-- @if (menuList != null) { @foreach (var menu in menuList) { "from Here" @if (menu.MainCategoryID == 0) { @InitializeCounter @menu.MenuName @menu.MenuName @foreach (var submenu in menuList) { @if (submenu.MainCategoryID == menu.MenuID) { @submenu.MenuName } }
@KsAmJ
@KsAmJ 4 года назад
thanks for the video. i have couple of questions why did you make the Interfaces in the Data Access Lib (what are the benefits of that) also why you added them on startup not as Singleton but as Transient..thanks again
@KsAmJ
@KsAmJ 4 года назад
what would happen if added as Singleton
@IAmTimCorey
@IAmTimCorey 4 года назад
I used interfaces so that I can more easily replace the data access type with a different type. That is most commonly beneficial in unit testing, where I can mock the data access class. It also allows me to more easily make changes to my code without reworking the entire project. If I decide to make a better data access class, I can just do that and then change the reference in one place and the entire application will use the better data access. If I used the class name directly, I would need to make changes to every location that used that class name. As for why I used Transient instead of a Singleton, I did that because the class stores data (the connection string name). If I used it as a singleton and one location changed the connection string name to something other than default, that change would affect everywhere in my application.
@KsAmJ
@KsAmJ 4 года назад
@@IAmTimCorey Thanks for explaining
@arnotek
@arnotek Год назад
I haven't built web applications in a while and the world moved - wow!. It may have been 3 years since you recorded this, but this is EXACLTY what I needed to get back into this arena. Thank you.
@IAmTimCorey
@IAmTimCorey Год назад
That's great!
@pjn2001
@pjn2001 Год назад
@@IAmTimCorey Hi Tim. Thanks for all your excellent content that you put out. I was curious to know if this video is still relevant in regards to .net 7/8 or should I be looking at other more recent videos?
@IAmTimCorey
@IAmTimCorey Год назад
Yep, it mostly is. The biggest thing will be that Program.cs and Startup.cs have been collapsed into just Program.cs. I have a video covering the differences. Other than that, the rest is almost entirely still relevant.
@pjn2001
@pjn2001 Год назад
@@IAmTimCoreyGreat stuff. Seems like nothing major then. I will definitely check out that video as well. Thank you so much for taking the time to respond sir, it is much appreciated.
@gbodunjo
@gbodunjo 4 года назад
Hi Tim, Great work! is there any chance of making a video that Edits and deletes the data to this video? Also wondering what the best way is to a task scheduler that shows the monthly activity?
@IAmTimCorey
@IAmTimCorey 4 года назад
I cover that in the Blazor Server In Depth course: www.iamtimcorey.com/p/blazor-server-in-depth As for a task scheduler that shows monthly activity, it depends on what you mean. If you mean something gets executed once a month, a Worker Service could do that. If you mean something shows the last month of activity, that doesn't need to be scheduled, it would just be a report or display that shows the result of a query from the past month from today.
@gbodunjo
@gbodunjo 4 года назад
OK. I meat like a course time table where you enter the courses and people can see the day and time of thier courses through the calendar for the month or week etc
@gbodunjo
@gbodunjo 4 года назад
@@IAmTimCorey Thanks, I've enrolled on the course:)
@verttix
@verttix 3 года назад
Tim, in my environment our applications are subfolders under the root of the site. My links in Blazor keep getting 404 errors because it's not staying with in the subfolder. Am I missing a setting to correct this? Thanks
@IAmTimCorey
@IAmTimCorey 3 года назад
This answer should help you: stackoverflow.com/a/52363003/733798
@GMP93
@GMP93 3 года назад
How Blazor updates the UI on the browser? It work with React in the background?
@IAmTimCorey
@IAmTimCorey 3 года назад
No, it uses SignalR to transmit the data and then a small, custom JavaScript library to take that data and update the display. No React necessary.
@cissemy
@cissemy Год назад
Hi Tim, How can I modify SaveData to return inserted identity ? Thanks
@IAmTimCorey
@IAmTimCorey Год назад
It depends on how you return the value. You can return it as a output parameter or you could return it as a select statement. If you return it as a select statement, you would just call LoadData instead of SaveData (you can still save data with the LoadData method). The Dapper documentation has instructions on output parameters.
@muhanad102
@muhanad102 2 года назад
I noticed when you hit buttons like submit the page doesn't refresh. Is this because of SignalR?
@IAmTimCorey
@IAmTimCorey 2 года назад
Yep. It acts like a client-side app. It doesn’t do a full-page refresh for updating or getting data.
@marcinjuranek4473
@marcinjuranek4473 3 года назад
Thank you, this is awesome. I don't like javascript. C# everywhere!
@IAmTimCorey
@IAmTimCorey 3 года назад
You're welcome!
@bardus_hobus
@bardus_hobus 2 года назад
Just FYI - there is a misspelling for your 4:46 time marker. It says "Balzor" rather than Blazor :)
@IAmTimCorey
@IAmTimCorey 2 года назад
Bummer. Not something I can change now, though.
@nelfstor
@nelfstor Год назад
Thank you for brilliant tutorials. English is not my native, but i understand you explanations like it is)
@IAmTimCorey
@IAmTimCorey Год назад
Glad to hear that!
@-M3-
@-M3- 2 года назад
Would it be appreciated if you incorprate API into this sample app. (as a part of blazor server, not a additional api project) Is it simple ?
@IAmTimCorey
@IAmTimCorey 2 года назад
It is simple. Add an API controller, add the MapControllers() directive to Startup.cs (or Program.cs if you are using .NET 6) and you should be set.
@etiennesteyn41
@etiennesteyn41 3 года назад
without giving away my age here but i am having flash backs to Active server pages.....
@tomthelestaff-iamtimcorey7597
@tomthelestaff-iamtimcorey7597 3 года назад
Oh, are we doing fastbacks? Tim and I were talking the other day and I flashed back to Radio Shak RS-80
Далее
ХОККЕЙНАЯ КЛЮШКА ИЗ БУДУЩЕГО?
00:29
Ответы Мэил Ру
01:00
Просмотров 1,1 млн
What is the Future of Blazor? Should I Learn Blazor?
22:32
You don't need a frontend framework
15:45
Просмотров 126 тыс.
The Blazor Competitor is Here!
15:08
Просмотров 71 тыс.
.NET and C# are in trouble. Here is what I'd do.
10:57
Stop Using FirstOrDefault in .NET! | Code Cop #021
12:54
Brutally honest advice for new .NET Web Developers
7:19