EFCore コンソールアプリ
データモデルの作成
アプリケーションのコンテキストクラスとエンティティクラスを作成するには、2つのアプローチがあります。コードファーストアプローチ アプローチでは、クラスを手動で書くことでモデルを微調整できます。あるいは、リバースエンジニアリング(Scaffolding) を利用してMicrosoft Dynamics NAV スキーマからこれらのクラスを自動生成することもできます。
コードでLINQ コマンドを実行する
Entity Framework Core をセットアップしてMicrosoft Dynamics NAV プロバイダーを登録すると、コード内でLINQ を実行することができます。
using System.Linq;
using MySolutionName.Models;
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); // Include this if you would like to use code pages not bundled in .NET Standard.
DynamicsNAVContext ents = new DynamicsNAVContext();
var CustomerQuery = from Customer in ents.Customer
orderby Customer.Contact
select Customer;