リポジトリ クラスをテストするためにモグラを作成しました。DefaultIfEmpty(new Drivers()) を配置すると機能しますが、プログラムを実行すると、次のエラーが表示されます。
しかし、それをDefaultIfEmpty()に戻すと、正常に動作しますが、私の *強いテキスト* ほくろテストは null 値を返すようになりました.ここに私のコードがあります:
var result = from p in this.context.AirPositions
join a in this.context.Airplane p.airplane_id equals a.id
join s in this.context.Status on p.status_id equals s.id
join dp in this.context.DriversPositions on p.id equals dp.position_id into dpJoin
from ds in dpJoin.DefaultIfEmpty(new DriversPosition())
join d in this.context.Drivers on ds.driver_id equals d.id into dsJoin
from drs in dsJoin.DefaultIfEmpty(new Driver())
orderby p.timesent descending
select new PositionViewModel()
{ ... };