LaunchCode-Education-Archived / csharp-web-development

Unit 2 (C# Track) of the LC101 Curriculum, following fundamentals in JavaScript
https://education.launchcode.org/csharp-web-development/
GNU General Public License v3.0
5 stars 9 forks source link

Chapter 19 Notes #98

Open scottkuhl opened 4 years ago

scottkuhl commented 4 years ago

Naming conventions in the database are not consistent. The fields are Pascal Case but the tables are Lower Case. In the previous chapters, tables and fields were both Snake Case. I think in this chapter it should at least follow the Pascal Case naming convention consistently.

Passwords in the connection string may trip security bot warnings when the students check in their code to GitHub. I don't have a good AND easy way around this. If it was SQL Server on Windows we could change the type of connection to Integrated Authentication and not need a user name and password. In this case, the proper way to handle this connection with a password is with an App Secret.

Thank you for using Id and not ID. That's just a personal pet peeve of mine. ;)

As a best practice, students should be using SaveChangesAsync and not SaveChanges, but that may be beyond the scope of this course. Maybe worth mentioning as a note?

Another best practice that is not mentioned for web apps is to always use .AsNoTracking when retrieving data that is not going to be updated which is most of the time. This adds a large amount of overhead in EF when populating lists.