Summary

Storing and retrieving data is an essential part of most web applications, and you can choose all kinds of databases to work with. EF Core is an O/RM that lets you write classes and LINQ queries, and those will be mapped to the database tables and to SQL statements without you needing to leave the comfort of the C# language. In this chapter, I explained how to work with EF Core and how you can use the DbContext base class to create a bridge between your classes, the database, and the conventional mapping it uses. You've seen how to store data and how to retrieve it with various LINQ operators. You also added automatic migrations to your application, which allows the database to be created and migrated to newer versions automatically without the need to run scripts in the database server itself.

I explained why you shouldn't use the same types of your data model when you return responses from your APIs, and instead, use DTOs. To make development easier, I introduced AutoMapper and showed you how easy it is to create reusable mappings, instead of writing repeatable mapping code. 

In the next chapter, you'll learn how to make your APIs more secure, and how to control access to API actions for authorized users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.237.89