i have an idea what it might be.....
obviously you can see there is a hierarchical relationship (EvidenceQuestionGroupAssignmentEntity contains an EvidenceQuestionCollection ina propertyEvidenceQuestion).
However.... i neglected to mention that this EvidenceQuestion collection is NOT part of the generated code but is in my BLL partial class. this is because i want to return a filtered EvidenceQuestionCollection as a public property of the EvidenceQuestionGroupAssignmentEntity.
That is to say, I have a partial class definition for EvidenceQuestionGroupAssignmentEntity which defines a public property EvidenceQuestion (which is an EvidenceQuestionCollection).
Her is the code for that:
Namespace VSurvey.DAL.EntityClasses
Partial Public Class EvidenceQuestionGroupAssignmentEntity
#Region "Properties"
Private evQuestions As EvidenceQuestionCollection
''' <summary>
''' EvidenceQuestion for the questions from the related group
''' </summary>
''' <value></value>
''' <returns>EvidenceQuestionCollection</returns>
''' <remarks></remarks>
Public Property EvidenceQuestion() As EvidenceQuestionCollection
Get
If evQuestions Is Nothing Then
evQuestions = New EvidenceQuestionCollection()
Dim relations As IRelationCollection = New RelationCollection()
relations.Add(EvidenceQuestionEntity.Relations.EvidenceEntityUsingEvidenceId)
relations.Add(EvidenceQuestionEntity.Relations.QuestionEntityUsingQuestionId)
relations.Add(QuestionEntity.Relations.QuestionGroupEntityUsingQuestionGroupId)
Dim filter As New PredicateExpression(QuestionFields.QuestionGroupId = Me.QuestionGroupId)
filter.Add(New PredicateExpression(EvidenceFields.Id = Me.EvidenceId))
filter.Add(New PredicateExpression(EvidenceQuestionFields.Deleted = 0))
filter.Add(New PredicateExpression(QuestionFields.Deleted = False))
Dim sorter As New SortExpression(New SortClause(EvidenceQuestionFields.SortOrder, SortOperator.Ascending))
evQuestions.GetMulti(filter, 0, sorter, relations)
End If
Return evQuestions
End Get
Set(ByVal value As EvidenceQuestionCollection)
evQuestions = value
End Set
End Property
#End Region
#Region "Overriden Methods"
Protected Overrides Sub OnGetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
info.AddValue("evQuestions", evQuestions)
MyBase.OnGetObjectData(info, context)
End Sub
Protected Overrides Sub OnDeserialized(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
Dim type As System.Type = System.Type.GetType("System.Object")
evQuestions = CType(info.GetValue("evQuestions", type), EvidenceQuestionCollection)
MyBase.OnDeserialized(info, context)
End Sub
#End Region
End Class
End Namespace
Therefore i am not sure that the presence of dirty entities in that collection "register" in the save as entities to be updated.
Is ther a way to add this new property to the list of properties the EvidenceQuestionAssignmentEntity checks for IsDirty etc when performing EvidenceQuestionAssignmentEntity.Save(True) method?