次のコード行をデバッグしようとしています
binding.DataSource = this.bindingSource.DataSource;
binding.DataSource に関する詳細情報を知りたい
イミディエイト ウィンドウでクエリ ? binding.DataSource が返す
Count = 1
[0]: {Contact Events}
binding.DataSource をインテリセンスでクエリできるものにキャストしたいですか? 何にキャストすればよいですか?
[更新] バインディング ソースは次のように作成されました。
public BindingSource GetEventTypesBindingSource()
{
try
{
DbSet<ContactEventType> dset = base.Context.ContactEventTypes;
IOrderedQueryable<ContactEventType> qry = dset.Where(p => p.Id > 0).OrderBy(x => x.Description);
qry.Load();
var bindingSource = new BindingSource();
bindingSource.DataSource = dset.Local.ToBindingList();
return bindingSource;
}
catch (Exception ex)
{
HandleException.Show(ex);
}
return null;
}
【更新】デバッガで以下を試してみました
? (List<ContactEvent>) binding.DataSource.GetType()
しかし得る
The type or namespace name 'List' is not valid in this scope