gethashcode
Entity Framework 4 overwrite Equals and GetHashCode of an own class property
I’m using Visual Studio 2010 with .NET 4 and Entity Framework 4. I’m working with POCO Classes and not the EF4 Generator. I need to override the Equals() and GetHashCode() methods, but that doesn’t[详细]
2023-01-02 22:05 分类:问答C# how to calculate hashcode from an object reference
Folks, here\'s a thorny problem for you! A part of the TickZoom system must collect instances of every type of object into a Dictionary<> type.[详细]
2023-01-01 11:25 分类:问答What must be done to use the value of a reference type as a dictionary key?
Suppose I have a class T that I want to use as a key in a Dictionary<T,U> collection. What must I implement 开发者_运维百科in T so that these keys are based on values of T rather than T referen[详细]
2022-12-31 09:52 分类:问答NHibernate set : Should I override Equals and GetHashCode?
I am new to NHibernate. I am using <set ... > mapping for some many-to-one and many-to-many associations. These are exposed as properties of type ICollection<T>, in practice implemented by[详细]
2022-12-28 21:08 分类:问答Does c# have the same issues like Java with equals and gethashcode()?
Does c# have the same issues like Java with equals and gethashcode? issues like: http://onjava.com/pub/a/onjava/20开发者_JS百科06/09/13/dont-let-hibernate-steal-your-identity.htmlIf you mean that equ[详细]
2022-12-26 23:11 分类:问答How to implement IEquatable<T> when mutable fields are part of the equality - Problem with GetHashCode
I am using Entity Framework in my application. I implemented with the partial class of an entity the IEquatable<T> interface:[详细]
2022-12-26 20:15 分类:问答Why should the "prime-based" hashcode implementation be used instead of the "naive" one?
I have seen that a prime number implementation of the GetHashCode function is being recommend, for example here. However using the following code (in VB, sorry), it seems as if that implementation giv[详细]
2022-12-23 11:52 分类:问答GetHashCode on null fields?
How do I deal with null fields in GetHashCode function? Module Module1 Sub Main() Dim c As New Contact Dim hash = c.GetHashCode[详细]
2022-12-23 11:30 分类:问答What's the best strategy for Equals and GetHashCode?
I\'m working with a domain model and was thinking about the various ways that we have to implement these two methods in .NET. What is your preferred strategy?[详细]
2022-12-21 21:02 分类:问答Getting KeyNotFoundException when using key previously retrieved from key collection?
I\'ve got the following code where for some reason 开发者_JAVA技巧I\'m getting a KeyNotFoundException even though I\'m using a key that I had retrived a couple of lines above.Does anyone know of a sit[详细]
2022-12-17 00:46 分类:问答
加载中,请稍侯......