shashisadasivan / EDMXTrimmer

D365 Finance and operations EDMX trimmer
MIT License
21 stars 12 forks source link

NavigationProperty #3

Closed cproehrich closed 5 years ago

cproehrich commented 5 years ago

Hello, Nice work with this trimmer. It is very useful. I noticed after running it and building a proxy class from the new EDMX file that SalesOrderHeader does not have a SalesOrderLine collection in it because the NavigationProperty is being removed from EntityType. What is the reason you excluded NavigationProperty from the EntityType? Just to keep the size down? I would like to add it because if it is in, then you could reference in some C# code like:

foreach (var salesLine in salesOrder.SalesOrderLine) { Console.WriteLine(string.Format("Sales order line with description {0} contains item id {1}", salesLine.LineDescription, salesLine.ItemNumber)); }

cproehrich commented 5 years ago

Ok, I see why the NavigationProperty is being removed. I suppose if we want to add them back in for various entities it is just a matter of copying them from the original EMDX file to the trimmed down version and then also including those entities in the initial run of trimming the EDMX file down.
Thanks again for creating this as it will be helpful to the DAX community.

shashisadasivan commented 5 years ago

Ok, I see why the NavigationProperty is being removed. I suppose if we want to add them back in for various entities it is just a matter of copying them from the original EMDX file to the trimmed down version and then also including those entities in the initial run of trimming the EDMX file down. Thanks again for creating this as it will be helpful to the DAX community.

Thanks for the feedback :) I havent looked much into the structure of this, however, if you leave navigation properties, then you have to have their definitions. So might be something that the code will need to extract and put it in.