Hello,
I am an user of LLBLGen Pro from way back who has recently inherited a project that uses LLBLGen Pro 2.6. The generated classes in source code control do not match the LGP file we have (i.e. the LGP file we have is outdated).
I am attempting to update the LGP file to match the database and more closely match the existing generated classes so that the rest of the system will compile with newly generated classes. By looking at the generated classes in source control, I see that someone defined a custom 1:1 relationship between a table and view. The table is named Application and the view is named VwJobQuestionSummary. These should join on Application.Id and VwJobQuestionSummary.ApplicationId.
Here's a snippet of the generated classes that show it is a 1:1 relationship.
/// <summary>Returns a new IEntityRelation object, between ApplicationEntity and VwJobQuestionSummaryEntity over the 1:1 relation they have, using the relation between the fields:
/// Application.Id - VwJobQuestionSummary.ApplicationId
/// </summary>
public virtual IEntityRelation VwJobQuestionSummaryEntityUsingApplicationId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToOne, "VwJobQuestionSummary", true);
relation.AddEntityFieldPair(ApplicationFields.Id, VwJobQuestionSummaryFields.ApplicationId);
But here's my challenge. I go into the LLBL model wizard and try to add this relationship, I select "Add new 1:1/1:n/m:1 relationship" but no matter what I do, I can't get it to create the relationship as 1:1. It always creates it as 1:n. I have confirmed that the view does not contain more than one row with the same ApplicationId.
Can you guide me on how to indicate that I want the relationship to be created as 1:1 instead of 1:n?
Thanks very much for you help,
Dave Weber