Hi,
I have two tables, both with a projectID. I want to place an inner join on these tables but also inner join all fields with a NULL value ...
So in SQL I can do this like:
INNER JOIN
dbo.Subscription ON ISNULL(dbo.AuditInfo.ProjectID, 0) = ISNULL(dbo.Subscription.ProjectID, 0)
Now I am trying to to this in LLBLGen:
IEntityField2 subscriptionProjectIdField = SubscriptionFields.ProjectId;
subscriptionProjectIdField.ExpressionToApply = new DbFunctionCall("ISNULL", new object[] { SubscriptionFields.ProjectId, 0 });
IEntityField2 auditInfoProjectIdField = AuditInfoFields.ProjectId;
auditInfoProjectIdField.ExpressionToApply = new DbFunctionCall("ISNULL", new object[] { AuditInfoFields.ProjectId, 0 });
IEntityRelation relation = new EntityRelation(auditInfoProjectIdField, subscriptionProjectIdField, RelationType.ManyToMany);
filter.Relations.Add(relation, JoinHint.Inner);
But the ISNULL functions are not in the generated SQL, there it's just:
INNER JOIN [MyDb].[dbo].[Subscription] ON [MyDb].[dbo].[AuditInfo].[ProjectID]=[MyDb].[dbo].[Subscription].[ProjectID])
Isn't it possible to do this with LLBLGen or have I made a mistake somwhere?!?