Solution: Back-End Development Challenge in C#
HTML-код
- Опубликовано: 18 сен 2024
- On Tuesday, I issued a challenge to build a data capture system in C#. Hopefully, by this time you have been able to build that system. If not, take the time to finish up your project before watching this video. Today, I am going to walk through the process of how I would tackle this challenge. Part of this process will be about knowing what steps to take next even as I complete the actual challenge. So let's get started building our back-end solution.
Full Training Courses: IAmTimCorey.com
Source Code: leadmagnets.ap...
Mailing List: signup.iamtimc...
I learn a lot from your precious tec teaching.
I learn from you : doing things good.
Thank you again Tim C. 🇫🇷
Brilliant! I sincerely believe that you are the best teacher of C# on the whole RUclips (or maybe in the Internet itself). I learned so many things from you dear Mr. Tim Corey! Texas and US must be proud to have people like you living in it!
Mr. Corey, can you recommend me a video where you do a CRUD operation of creating some record in some relational database in a child table (Purchases for example) and where table column with foreign key (CustomerId for example) automatically binds to a value of Id (Primary Key) in the Parent table (Customer for example) and sets this foreign key automatically appropriately to the Parent table Primary key? I am pretty sure that you did something like this but I failed to find it. I am really struggling with it and only managing to create record with NULL foreign key column.
And thank you so much again!
As a total newbie in C# and Dotnet this solution taught me a ton of concepts all at once. Thanks Tim! I wish something like a course which starts with simpler concepts teaching C# and dotnet and slowly with increasing complexity with the final result of a real production type application creation integrating all the concepts without teaching each concept in silos would be of great help.
That would be the C# Mastercourse ( www.csharpmastercourse.com/ ).
Dapper looks pretty good, will have to look into that. I spent way too long writing my own custom classes to access the database (just using SQL client dependency). Probably should have used a stored procedure too to check for existing callers (did my checking class side and posted back of there was a change detected) which would have ment less database calls.
I am glad it was helpful.
Never heard about the upsert technique ! Thanks Tim !!! I usually do that on the C# side of the project and I guess that it's way quicker when it's done by SQL itself.
I’m glad it was helpful.
Thanks a lot Tim, btw do you have video about model relationships(one to one...), I am using Entity Framework for that, It is bit uncomfortable, watching you creating procedures and using dapper seems interesting and more clear, at least some information from you about using this two methods(their pros and cons) will be really helpful
I missed the challenge. Had too much work to do. Thanks for the video.
You can always do it later.
Hmm, joined the challenge a but late, did the challenge a bit different... Used Api project and included Entity framework migrations with sqlite. So Api project is used to access database.
Question regarding your upsert. Do you normally just update all parameters even though say one columns data changed from the front end in a row of 10 columns. So either tracking changes by "isdirty" and building an update string
on those columns or comparing columns that are passed in to update to what is in the database and then building a sql string to update only what has changed?
In most cases, it is simplest to update all values that could change. Trying to track the dirty status and then forming specific queries to handle each case or doing dynamic queries (which can cause performance problems) just isn't worth it for most scenarios.
@@IAmTimCorey could be an issue for applications that have concurrency and high volume of users plus speed.. but i guess depends
New coder here!
Would highly appreciate it if someday you have the time to create a step by step tutorial for making a portfolio website.
We build one of those in here: www.webdevelopmentmastercourse.com/
I was going with EF Code First - do you think your Solution has benefits compared to ef code first approach?
I think it's a subjective answer. I personally like and went the EF route but you are relying and EF and if it breaks, do you know how to fix it. Tim Cory has a video explaining more why he doesn't really like it. Plus Dapper is still faster, esp. with the stored procedures this method enforces.
I saw this video just today. I would have definitely participated in this one if i saw it earlier. I'll be participating in next one. What i am thinking about is that it's a good initiative. I think we can have such weekly and monthly challenges and at the end of the challenges we can discuss different approach people came up with and why or why not some approach is good or bad. Right?
You can participate at any time. You didn't have to do it in real time. As for sharing approaches, I don't have a system for sharing solutions in place.
can you make a c#/NET tutorial for experienced Java/Spring developers?
What would that look like?
Why not use guid? And when to actually use guid
It would take a video to properly answer. However, here are some basics. First, an int is easier to refer to and remember. Second, an id is somewhat more performant. Third, an int takes up less space.
@IAmTimCorey thank you, I think it'd be a very good video to have, more videos related to design.
About guid, the advantaged I can think of are, no reference issues ever with duplicate record etc. A little bit safer, in case there was an unprotected API, attacker cant just do 1,2,3 and get admin records..And to generate a new guid you can do it on backend instead of going to db, and it's just extremely unique. But these are the only advantages I know.
But I see a lot of new projects even small ones using guid as pk in tables lately so I was wondering if I am missing out on something or if it's not a sql server thing and preferred in other databases like postgresql.
Genuinely really curious about this and it's hard to find information online and, thanks tim.
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
Nice vid mate
Thanks!
Great
Thanks!
You are the best
Thank you!
first
No one cares.
@@UnclaimedClockI do. I am the guy who cares
if u dn't care, no need to reply@@UnclaimedClock
It is actually helpful for telling RUclips the video should be shared more, so I care as well.
@@IAmTimCorey