I am trying to do left-join
using LINQ to NHibernate.
I have the following code:
var query = from formdat in _formDatRepository.Table
join proddat in _prodDatRepository.Table
on formdat.prodcode equals proddat.prodcode into proddats
select new Model
{
Brand = formdat.brand,
Generic = string.Empty
}
result = query.ToList();
This is throwing the exception:
The method or operation is not implemented.
Stack trace:
at NHibernate.Linq.CacheableExpressionNode.Resolve(ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext) at Remotion.Linq.Parsing.Structure.IntermediateModel.ExpressionResolver.GetResolvedExpression(Expression unresolvedExpression, ParameterExpression parameterToBeResolved, ClauseGenerationContext clauseGenerationContext) at Remotion.Linq.Parsing.Structure.IntermediateModel.JoinExpressionNode.<>c__DisplayClass1.b__0(ExpressionResolver r) at Remotion.Linq.Parsing.Structure.IntermediateModel.ResolvedExpressionCache
1.GetOrCreate(Func
2 generator) at Remotion.Linq.Parsing.Structure.IntermediateModel.JoinExpressionNode.CreateJoinClause(ClauseGenerationContext clauseGenerationContext) at Remotion.Linq.Parsing.Structure.IntermediateModel.GroupJoinExpressionNode.ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext) at Remotion.Linq.Parsing.Structure.IntermediateModel.MethodCallExpressionNodeBase.Apply(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext) at Remotion.Linq.Parsing.Structure.QueryParser.GetParsedQuery(Expression expressionTreeRoot) at NHibernate.Linq.NhLinqExpression.Translate(ISessionFactoryImplementor sessionFactory, Boolean filter) at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary2 filters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary
2 enabledFilters) at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow) at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression) at NHibernate.Linq.DefaultQueryProvider.PrepareQuery(Expression expression, IQuery& query, NhLinqExpression& nhQuery) at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) at NHibernate.Linq.DefaultQueryProvider.Execute[TResult](Expression expression) at Remotion.Linq.QueryableBase1.GetEnumerator() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at MasterCare.MIMS.Australia.Services.MIMSService.Search(String key)
Note:
There are no navigation properties since there are no foreign key relationships between the tables.