
Mastering Entity Framework Core 2.0
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Person
Prabhakaran Anbazhagan is a Microsoft Solution Architect living in Chennai, India. His passion for programming started while creating a website for his school, and that's where the never-ending journey started. He became the secretary of a technology group in college, creating websites yet again, automating symposiums, and much more. He started his career at a prestigious product-based company; his knowledge was respected and recognized by his seniors, who let him develop tools and automation to sharpen his talents. Lucky guy! People hardly ever get to nurture their talent, but he got a handful of opportunities to sharpen his skills and become a Solution Architect, becoming a jack of all trades but still an expert in.NET. Prabhakaran has more than 12 years of IT experience in architecting, designing, and developing mission-critical desktop, web, and mobile applications. He has experience in full-stack development spanning ASP.NET MVC, Web API, C#, Mobility expert in Swift, Objective-C, Blackberry Cascades, hybrid apps, SharePoint, JavaScript, jQuery, and MEAN.JS.
Content
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Customer Feedback
- Dedication
- Table of Contents
- Preface
- Chapter 1: Kickstart - Introduction to Entity Framework Core
- Prerequisites
- Creating a new project
- The Start page
- The File menu
- Structuring the web app
- Installing Entity Framework
- Data models
- [Post entity]
- Post entity
- Database context
- Registering the context in services (.NET Core DI)
- Creating and seeding databases
- CRUD operations
- Summary
- Chapter 2: The Other Way Around - Database First Approach
- Preparing the database
- Blog entity script
- Post entity script
- Creating new project
- Installing Entity Framework
- Reverse engineering the database
- Configuring data context
- Working with the Blog entity
- Working with the Post entity
- Registering context in services (.NET Core DI)
- Refactoring the OnConfiguring() method
- Refactoring the ConfigureServices method
- The appsettings.json setting
- Performing CRUD operations
- Creating controller action
- Edit controller action
- The Delete view
- Summary
- Chapter 3: Relationships - Terminology and Conventions
- Understanding relationship terms
- Data models
- Blog entity
- The Post entity
- Principal entity
- Principal key
- Dependent entity
- Foreign key
- Navigation property
- Collection navigation property
- Reference navigation property
- Inverse navigation property
- Conventions in a relationship
- Fully-defined relationships
- Fully-defined relationships - under the hood
- No foreign key property
- No foreign key property - under the hood
- Single navigation property
- Foreign key
- Inverse property
- Summary
- Chapter 4: Building Relationships - Understanding Mapping
- Relationships
- The one-to-one relationship
- Building one-to-one relationships using the Fluent API
- The one-to-many relationship
- The many-to-many relationship
- Building many-to-many relationship using the Fluent API
- Fluent API
- Identifying navigation property and inverse navigation
- Identifying the single navigation property
- Relationship-building techniques
- Building relationship using a foreign key
- Building relationships using a principal key
- Building relationships using the IsRequired method
- Cascade delete
- Data migration issue with EF Core 2.0
- Summary
- Chapter 5: Know the Validation - Explore Inbuilt Validations
- Diving into built-in validations
- Required field validation
- Incorporating the Required validation in blogging system models
- EmailAddress field validation
- Incorporating EmailAddress validation in blogging system models
- Compare field validation
- Incorporating the Compare validation in blogging system models
- Url field validation
- Incorporating Url validation in blogging system models
- MinLength field validation
- MaxLength field validation
- RegularExpression field validation
- Summary
- Chapter 6: Save Yourself - Hack Proof Your Entities
- Client-side validation
- Validating data without client-side scripting
- Server-side validation
- Manual validation
- Custom validation
- Creating client-side logic for custom validation
- Remote validation
- Summary
- Chapter 7: Going Raw - Leveraging SQL Queries in LINQ
- Basic raw SQL queries
- Building parameterized queries
- Composing with LINQ
- Executing SQL query without a DBSet or POCO
- Summary
- Chapter 8: Query Is All We Need - Query Object Pattern
- Introduction to query objects
- Improving repositories with the query object pattern
- Introduction to repositories
- Solution to the repository assignment
- Incorporating the query object pattern into repositories
- List query object support in the repository
- Single query object support in the repository
- Solution to the repository with the queries assignment
- Composing queries with commands
- Solution to the command queries assignment
- Enhancing queries with expression trees
- Solution to the expression trees assignment
- Summary
- Chapter 9: Fail Safe Mechanism - Transactions
- Default behavior of a transaction
- Adding tags support in the blogging system
- Leveraging default transaction behavior
- Creating a simple transaction
- Creating a cross-context transaction
- File upload support to the blogging system
- Limitations to the transaction scope
- Custom transaction scope support
- Adding date picker support to the blogging system
- Leveraging transactions between multiple technologies
- Recent posts support to the blogging system
- Anonymous posts list and individual blog post
- Listing comments
- Adding comments using external database transactions
- Summary
- Chapter 10: Make It Real - Handling Concurrencies
- Handling concurrency in EF
- Understanding the concurrency conflicts
- Optimistic concurrency
- Pessimistic concurrency
- Introducing concurrency tokens
- Non-timestamp based concurrency tokens
- Configuring non-timestamp tokens through data annotation
- Configuring non-timestamp tokens through Fluent API
- Timestamp-based concurrency tokens
- Configuring timestamp tokens through data annotation
- Configuring timestamp tokens through Fluent API
- Handling concurrency conflicts
- Applying optimistic concurrency
- Database wins
- Client wins
- User-specific custom resolution
- Applying pessimistic concurrency
- Summary
- Chapter 11: Performance - It's All About Execution Time
- The AsNoTracking() method
- How does tracking work?
- No-tracking queries
- Projections
- Detecting changes
- Asynchronous operations
- Transactions leveraging asynchronous operations
- Unnecessary volume returned
- The N+1 Select problem
- More data than required
- Mismatched data types
- Missing indexes
- Summary
- Chapter 12: Isolation - Building a Multi-Tenant Database
- Authentication in the blogging system
- Row-Level Security
- Filter predicate
- Block predicate
- Multi-tenancy
- Standalone
- Database-per-tenant
- Shared multi-tenant
- Dive into multi-tenancy
- Blocking cross-tenant write operation
- Summary
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.