EF Core Console Application
Creating the Data Model
There are two approaches to creating the context and entity classes for your application. Using the Code-First Approach approach, you can fine-tune your model by writing the classes manually. Alternatively, you can use Reverse Engineering (Scaffolding) to generate these classes automatically from your PostgreSQL schema.
Perform LINQ Commands in Your Code
After EF Core is set up and the PostgreSQL provider is registered, you can begin querying your data with LINQ:
using System.Linq;
using MySolutionName.Models;
PostgreSQLContext ents = new PostgreSQLContext();
var OrdersQuery = from Orders in ents.Orders
orderby Orders.ShipCity
select Orders;