filmov
tv
How to Implement Strongly Typed IDs with EF Core and ASP.NET Core Razor Pages

Показать описание
Related videos:
Do you pass strings and ints around your application? Nah, that's a primitive obsession!
Do you exchange enums between classes? Nah, that's an anemic domain model!
Then, why would one send raw ID values between classes and to the UI? Those raw IDs look that way because the database is fine with them, not because they are good in the domain model!
This video dissects the problem of ensuring strong typing when assigning ID values through all the application layers: in Entity Framework Core mappings, in the domain model and all the calls inside it, to Razor pages and HTML generation.
You will learn how to work with autoincrement numbers, common GUIDs, and lexicographically sortable UUIDs, each separately wrapped into a strong ID type that preserves assignment safety, including model binding to and from HTML.
⌚ 00:00 Intro
⌚ 01:14 Implementing a strong ID
⌚ 06:51 Mapping to EF Core and Razor pages
⌚ 10:55 Strongly typed model binding
⌚ 12:48 Using sortable UUIDs
⌚ 14:48 Using autoincrement IDs
⌚ 15:45 Demonstrating strongly typed IDs
⌚ 16:56 Outro
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️COPYRIGHT NOTICE:
The Copyright Laws of the United States recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.
#csharp #dotnet #entityframeworkcore
Комментарии