The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Problem with EntitySpaces 2008 RC1 (OnPropertyChanged calls)

Last post 06-13-2008, 12:24 AM by pritcham. 3 replies.
Sort Posts: Previous Next
  •  06-12-2008, 6:06 PM 9798

    Problem with EntitySpaces 2008 RC1 (OnPropertyChanged calls)

    Hi,

    Header details for the file below:

    Code:
    '===============================================================================
    '                     EntitySpaces(TM) by EntitySpaces, LLC
    '                 A New 2.0 Architecture for the .NET Framework
    '                          http://www.entityspaces.net
    '===============================================================================
    '                       EntitySpaces Version # 2008.0.0611.0
    '                       MyGeneration Version # 1.2.0.7
    '                       Date Generated       : 12/06/2008 19:30:22

    As you can see from the attached code snippet below (generated against Northwind running on SQL Server 2005), there appears to be an issue with the call to OnPropertyChanged (i.e. no property name is passed, just an empty string) - this is the same for all properties generated I'm afraid.

    Code:
    		' <summary>
    		' Maps to Customers.CompanyName
    		' </summary>
    		Public Overridable Property CompanyName As System.String
    			Get
    				Return MyBase.GetSystemString(CustomersMetadata.ColumnNames.CompanyName)
    			End Get
    			
    			Set(ByVal value As System.String)
    				If MyBase.SetSystemString(CustomersMetadata.ColumnNames.CompanyName, value) Then
    					Me.MarkFieldAsModified(CustomersMetadata.ColumnNames.CompanyName)
    					Me.OnPropertyChanged("")
    					RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(CustomersMetadata.PropertyNames.CompanyName))
    				End If
    			End Set
    		End Property

    Thanks

    Martin

  •  06-12-2008, 6:47 PM 9799 in reply to 9798

    Re: Problem with EntitySpaces 2008 RC1 (OnPropertyChanged calls)

    Excellent catch !!  That extra call to Me.OnPropertyChanged("") is meant for a hierarchical node and the logic was wrong, this has been corrected, it is now:

    Code:
    		Public Overridable Property CompanyName As System.String
    Get
    Return MyBase
    .GetSystemString(CustomersMetadata.ColumnNames.CompanyName)
    End Get

    Set
    (ByVal value As System.String)
    If MyBase.SetSystemString(CustomersMetadata.ColumnNames.CompanyName, value) Then
    Me
    .MarkFieldAsModified(CustomersMetadata.ColumnNames.CompanyName)
    RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(CustomersMetadata.PropertyNames.CompanyName))
    End If
    End Set
    End Property


    The Fix is in already, if you need updated templates I can email them to you? let me know.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-12-2008, 7:02 PM 9800 in reply to 9799

    Re: Problem with EntitySpaces 2008 RC1 (OnPropertyChanged calls)

    For the record, here is how it looks with the extra property changed when a hierarchical node is involved:

     

    Code:
    		Public Overridable Property ReportsTo As Nullable(Of System.Int32)
    			Get
    				Return MyBase.GetSystemInt32(EmployeesMetadata.ColumnNames.ReportsTo)
    			End Get
    			
    			Set(ByVal value As Nullable(Of System.Int32))
    				If MyBase.SetSystemInt32(EmployeesMetadata.ColumnNames.ReportsTo, value) Then
    					Me.MarkFieldAsModified(EmployeesMetadata.ColumnNames.ReportsTo)
    					Me._UpToEmployeesByReportsTo = Nothing
    					Me.OnPropertyChanged("UpToEmployeesByReportsTo")
    					RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(EmployeesMetadata.PropertyNames.ReportsTo))
    				End If
    			End Set
    		End Property

     

    I was testing it too to make sure it works, thought I'd post it. 


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-13-2008, 12:24 AM 9801 in reply to 9799

    Re: Problem with EntitySpaces 2008 RC1 (OnPropertyChanged calls)

    Cheers Mike - thought I was going crazy at first but that's more down to the fact I was coding 'till the early hours!

    As for emailing new templates - if the fix is likely to be up in the next week then don't worry - if it may be a little longer then feel free to email them in the meantime.

    Thanks again

    Martin

View as RSS news feed in XML