Newest version as of last week. VS.NET 2005, Self-serving
I have a sub-type "PersonName" which has a relation to "Person"
When I generate the code, I get:
The type 'ERMS.Apps.TaskApprovals.DAL.RelationClasses.PersonNameRelations' already contains a definition for 'PersonEntityUsingPersonId'
The error is on the virtual method. I think it's trying to override PersonEntityUsingPersonId in the same class which I don't think you can do
The relationship was made manually in the GUI. If removed, this code block works fine, but then I get code generated with a GetMultiManyToOne, which doesn't exist in the sub-type "PersonName".
/// <summary>Returns a new IEntityRelation object, between PersonNameEntity and PersonEntity over the m:1 relation they have, using the relation between the fields:
/// PersonName.PersonId - Person.PersonSid
/// </summary>
public override IEntityRelation PersonEntityUsingPersonId
{
get
{
IEntityRelation relation = base.PersonEntityUsingPersonId;
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("PersonNameEntity", true);
return relation;
}
}
/// <summary>Returns a new IEntityRelation object, between PersonNameEntity and PersonEntity over the m:1 relation they have, using the relation between the fields:
/// PersonName.PersonId - Person.PersonSid
/// </summary>
public virtual IEntityRelation PersonEntityUsingPersonId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne);
relation.StartEntityIsPkSide = false;
relation.AddEntityFieldPair(EntityFieldFactory.Create(PersonFieldIndex.PersonSid), EntityFieldFactory.Create(PersonNameFieldIndex.PersonId));
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("PersonEntity", false);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("PersonNameEntity", true);
return relation;
}
}