F24_PROG1322_02.3_Step 3A - Validation and Database Errors

F24_PROG1322_02.3_Step 3A - Validation and Database Errors

We add IValidatableObject for class level validation. Next we look at our controllers and see how we protect against Cross-Site Request Forgery (CSRF) attacks and Overposting Attacks. Then we explore how to catch errors coming from the database by using trycatch.br br Performance can be improved by using .AsNoTracking() in our LINQ when we are getting data from the database with no intention of changing the data. Finally we change the approach to the Edit process to follow industry best practice. Instead of just replacing the object in the database, we update it with TryUpdateModel.br br 0:00 Class Level Validaiton - IValidatableObjectbr 4:15 Validate Nullable "sometimes" for OHIPbr 9:00 Start new set of Migrationsbr 11:45 Controller Improvementsbr 12:45 LINQ and .Include() br 16:45 .AsNoTracking()br 20:45 ValidateAntiForgeryTokenbr 22:10 Overposting Attacksbr 27:20 Database Errors - TryCatchbr 32:10 Edit Get - .


User: dstovell

Views: 0

Uploaded: 2024-12-20

Duration: 48:08

Your Page Title