@Jose I have been using an ICollection field as in your example, but with a .Net HashSet instance (sometimes with an IEqualityComparer as well).
I get set semantics in my object model - can you please clarify what set operations are missed this way? As an aside, is there any reason to think NHib will ever support the HashSet? Cheers, Berryl On Dec 23, 3:44 am, José F. Romaniello <[email protected]> wrote: > The only way to use SETs in nhibernate is with Sets from Iesi.Collections. > Having say that your field or property type could be ICollection but the > instance in transients objetcs must be set, this is an example: > > public class Invoice > { > private ISet<InvoiceLIne> lines = new HashedSet<InvoiceLine>(); > > public ICollection<InvoiceLine> Lines {get{return lines;}} > > } > > this is ok too: > > public class Invoice > { > private ICollection<InvoiceLine> lines = new HashedSet<InvoiceLine>(); > > public ICollection<InvoiceLine> Lines {get{return lines;}} > > } > > but you miss sets operations. > > 2010/12/23 Max André Bündchen <[email protected]> > > > > > > > > > I'm reading the NHibernate 3.0 Cookbook and a question appeared when I > > played with NHibernate. As the System.Collections.Generic.ISet is not > > supported in <set> mappings, I can use the > > Iesi.Collections.Generic.ISet or the > > System.Collections.Generic.ICollection. > > > What's the drawback of use native ICollection instead of ISet? I found > > a few topics about it but not a clear answer. > > > -- > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected] > > > > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
