Hello everybody,
i have a project with a Datagrid (Host),
another Project with an Interface(Contract) and
a third Project (Plugin) which References the contract like the host.
(All of them in .Net 4.6)
Seems like normal MEF till now.
I use EF6 inside the Plugin to get information for the host.
So the Host asks for Information and i want to bind the datagrid from the host onto the Information i get from EF.
But I get an IQueryable<EF6Entity> from Ef which i cant give my host because he doesnt know "EF6Entity".
I cast the IQueryable<EF6Entity> to a DataTable right now, but i lose every functionality this way. Like updating the information from datagrid to the database or vice versa.
What do i want to archive:
The host wants data. The Plugin gives the data and if the data (in database) changes, the data inside the host gets updated("Real Time" update for the datagrid.)
The other way around if something changes in my datagrid after i click a "Save Button" the database should be updated.
What is the best approach to get that behaviour? (a code snippet would be nice)
(Cast ObservableCollection + DTO? seems meh. Maybe Reflection?)
Thank you all in advance.
[Export("Test_Informations";, typeof(ITest_Informations))]
public class Test_Informations : ITest_Informations
{
public DataTable GetSomeInformations_DataTable()
{
someInformations = getAllSomeData();
return castToDataTable(someInformations);
}
}