EF Core コンソールアプリケーション
データモデルの作成
アプリケーションのコンテキストクラスとエンティティクラスを作成するには、2つのアプローチがあります。 コードファーストアプローチ アプローチを使用して、クラスを手動で書くことでモデルを細かく調整できます。 あるいは、リバースエンジニアリング(Scaffolding) を使用してAzure Active Directory スキーマからこれらのクラスを自動生成することもできます。
コードでLINQ コマンドを実行
EF Core をセットアップしてAzure Active Directory プロバイダーを登録すると、LINQ を使用してデータのクエリを開始できます。
using System.Linq;
using MySolutionName.Models;
AzureADContext ents = new AzureADContext();
var DirectoryRolesQuery = from DirectoryRoles in ents.DirectoryRoles
orderby DirectoryRoles.displayName
select DirectoryRoles;