Hi Allen
asowles wrote:
The problem that we are having is that the EmployeeEntity is created with an empty EmployeeRules Entity and not null. This causes problems because when we call to save the EmployeeEntity, the EmployeeRules entity is not valid and it generates errors.
Please elaborate more on "is not valid and generate errors".
asowles wrote:
How do we prevent it from creating a blank, invalid entity instead of null?
As a matter of fact, any m:1/1:1 related entity will be accessible as NULL if no related entity exists.
What LLBLGen build version and runtime library version are you using? (http://llblgen.com/TinyForum/Messages.aspx?ThreadID=7725)
rdhatch wrote:
In the Designer, please look at your Options. There is an option for LazyLoadingReturnsNewIfNotFound. Make sure you turn this OFF. You will now get NULL for an entity instead of a New Entity.
This flag is SelfServicing specific, Allen is using Adapter.
BTW...
rulesCollection.Add(EmployeeEntity.Relations.EmployeeRulesEntityUsingCompanyIdEmployeeId, JoinHint.Left);
...
prefetchPath.Add(EmployeeEntity.PrefetchPathEmployeeRules, 0, null, rulesCollection);
You don't need to do that (add a relationcollection to the path), unless you pass a PredicateExpression to the prefetchPath.