Two of the tables in my database are Personnel and Nationality. I recently had the need to add a ThreeLetterCode field to the Nationality table and a CountryOfResidence field in the Personnel table, linked to the Nationality table. There is already a Nationality fields in the Personnel table which is linked so I have created a second link between the two tables.
I expected everything to be fine so I refreshed the catalog, generated the code and tried to rebuild it only to see errors in NationalityEntityBase.vb and SalutationEntityBase.vb:
Option Strict On disallows implicit conversions from 'SD.LLBLGen.Pro.ORMSupportClasses.IPredicateExpression' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntity'
In the GUI there are four relationships between Salutation and Nationality via Personnel, none of which are needed. Can I remove these relations from the GUI? If so how? I don't want to remove the individual links between Nationality and Personnel and Salutation and Personnel. Is it possible that this is causing the problem?
The generated code where the error is being flagged is:
''' <summary>Retrieves all related entities of type 'PersonnelEntity' Imports a relation of type '1:n'.</summary>
''' <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
''' <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
''' <param name="filter">Extra filter to limit the resultset.</param>
''' <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
Public Overridable Function GetMultiPersonnel(forceFetch As Boolean, entityFactoryToUse As IEntityFactory, Filter As IPredicateExpression) As TravBase.CollectionClasses.PersonnelCollection
If ( Not _alreadyFetchedPersonnel Or forceFetch Or _alwaysFetchPersonnel) AndAlso Not MyBase.IsSerializing AndAlso Not MyBase.IsDeserializing AndAlso Not MyBase.InDesignMode Then
If MyBase.ParticipatesInTransaction Then
If Not _personnel.ParticipatesInTransaction Then
MyBase.Transaction.Add(_personnel)
End If
End If
_personnel.SuppressClearInGetMulti = Not forceFetch
If Not entityFactoryToUse Is Nothing Then
_personnel.EntityFactoryToUse = entityFactoryToUse
End If
_personnel.GetMultiManyToOne(Me, Nothing, Nothing, Filter)
_personnel.SuppressClearInGetMulti = False
_alreadyFetchedPersonnel = True
End If
Return _personnel
End Function
I tried updating to the latest version of LLBLGen Pro from 2.5 and regenerating - that gave me loads more errors in my related project but didn't get rid of this problem!
Edit: I've got rid of all problems except this one now
Any ideas as to how to get round this problem?
I am developing against .NET 2.0 in Visual Studio 2008 using VB