I have a ComponentOne Grid control on a WinForm Application and I'd like to bind a "LINQ Query" instead of the whole DbSet.
If I need the full DbSet the answer is here: Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported Entity Framework 5
gridControl1.DataSource = context.capitulo.Local.ToBindingList();
context.capitulo.Load();
But this do not work if I want to put an order and /or a where condition like:
gridControl1.DataSource = context.capitulo.OrderBy(x => x.Id).Local.ToBindingList();
context.capitulo.Load();
Because Local
is a property of DbSet
and not of IQuerable
.
I found lots of solution for WPF but non solution for WinForms.