Hi sarmaad;
This may be a bug but I will confirm. It looks like for now, you have to do the following workaround.
1. Create EntityRelations.Unit_StockCompany and EntityRelations.Building_StockCompany.
2. You can do so by going to your EntityRelations partial class inside your IB.Designer.cs and just copy paste the code for EntityRelations.Stock_StockCompany and change it to Unit and Building.
3. It's probably safer to place this new EntityRelations to a different class where you can create another EntityRelations partial class.
4. And do the following logic to create a different EntitySpan depending on the type.
if (stock is Stock) { var span1 = new EntitySpan(typeof(Stock), EntityRelations.Stock_StockCompany, EntityRelations.Company_StockCompany); }
if (stock is Unit) { var span1 = new EntitySpan(typeof(Unit), EntityRelations.Unit_StockCompany, EntityRelations.Company_StockCompany); }
if (stock is Building) { var span1 = new EntitySpan(typeof(Building), EntityRelations.Building_StockCompany, EntityRelations.Company_StockCompany); }
|
Please let me know whether this works for you or not. I'll do more investigation on my end to find out whether this is a bug and if there's a better workaround.