You shouldn't need to do a custom Equals method, you should just be able to override standard Equals. The proxy would be a subclass of your entity class, so you shouldn't have any trouble with that; overriding Equals and GetHashCode is generally the solution for this kind of issue.
On Thu, Jan 15, 2009 at 11:17 PM, Brendan Erwin <brendanjer...@gmail.com>wrote: > > Ok, I have a possible solution to this. > > (Has this not bitten anyone else?) > > I wrote a DuckEquals method that behaves a lot like Equals except it > uses reflection to do the comparison based on property name, type, and > value. > > Basically, if the right hand side has at least the same properties as > the left hand side and they are the same values then it returns true. > > I have Specs (tests) written and the method written as an extension > method. Does this sound like a viable approach to this problem? If so, > where should I put the code? > > > > On Jan 15, 2009, at 4:11 PM, Brendan Erwin wrote: > > > My PersistenceSpecification is failing with this error: > > > > System.ApplicationException: Expected > > 'Clearwave.Integration.Models.Contact.ContactRoleType' but got > > 'ContactRoleTypeProxyc2c0603157224549b77250fe16aca4de' for Property > > 'Type' > > > > When testing: > > > > .CheckReference(x => x.Type, new ContactRoleType() { Description = > > "Desc", Name = "Name" }) > > > > > > Is this an issue with the comparison logic in the > > PersistenceSpecification or am I missing something? > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---