locked
MVVM Repository Pattern in VB.net RRS feed

Answers

  • Hi Omar,

    I went through your code and you only need to make a slight change to make it get changed records correctly - 

    Public Function IsChanged(ByVal copy As T) As Boolean
            Dim original = _originals(_copyIndex(copy))
    
            Return Not original.Equals(copy)
        End Function

    I only had to add the word "NOT" in the return statement.

    • Proposed as answer by Sheldon _Xiao Monday, March 19, 2012 7:25 AM
    • Marked as answer by Omar Mir Monday, March 19, 2012 12:52 PM
    Sunday, March 18, 2012 9:52 AM

All replies

  • Hi Omar,

    I went through your code and you only need to make a slight change to make it get changed records correctly - 

    Public Function IsChanged(ByVal copy As T) As Boolean
            Dim original = _originals(_copyIndex(copy))
    
            Return Not original.Equals(copy)
        End Function

    I only had to add the word "NOT" in the return statement.

    • Proposed as answer by Sheldon _Xiao Monday, March 19, 2012 7:25 AM
    • Marked as answer by Omar Mir Monday, March 19, 2012 12:52 PM
    Sunday, March 18, 2012 9:52 AM
  • Right! Works - what about Overriding GetHasCode - needs to be done for sure here?
    Monday, March 19, 2012 1:20 AM
  • Hi Omar,

    I'm not sure why you want to override the GetHashCode? I'm not sure what you want to achieve by it. But i think the original question has been answered. It would be fair (in my opinion) for you to close this thread and ask that question in a new thread.

    Thanks.

    Monday, March 19, 2012 10:23 AM
  • Thanks Omar. That's really appreciated.
    Monday, March 19, 2012 1:42 PM