c# - EF 5 cast a ICollection into another -
I have a component that accepts two types of data sources
Public Interface Ia .. Icons & lt; Ib & gt; Expansion {Received; Set; }} Public Interface IB {....} Then I have two EF classes that implement the interface
Public class B: IB { } And my problem here is how to expand MyDetail in MyDetail by expanding and expanding, I use MyDetail for detail in the
public class a: Ia {public virtual Ichlanack & lt; B & gt; MyDetail {get; set;} // How to expand MyDetal to detail and expand on MyDetail / some public virtual Icicle & lt; Ib & gt; Expansion {get {return MyDetail;} set {MyDetail = value}}}} Is that correct? Is there another incomplete for this conversation?
You can not do this Icoding is not coherent, so you can Icon ; As Icoding Ib & gt; (in the recipient), and can not treat the nutrients, so you can the icon Icoding B & gt; (in setter) can not be treated. Icoding & lt; T & gt; is irreversible (Note that it is impossible for any kind of nutrient and sect ever. It is best for your recipient to do that Make a new collection and copy all the elements. You know that it will be successful, but you need to make a copy.
For your setter, you will also need to create a new collection , But here you have all the items Ms has no idea that in fact b objects, so you have to know how to handle any handle (whether you release them, throw exceptions, or what).
Comments
Post a Comment