Can anyone tell me how I can make one of the relationships in this typed list query a left join? I have a relation between Product.ProductID and ProductBlurb.ProductID, and since I can't expect a blurb to always be there I need to make this join a left join so I still get the product from the query.
public FramesTypedList GetFramesForManufacturer(string styleGeneral, string manufacturer)
{
FramesTypedList frames = new FramesTypedList();
IRelationPredicateBucket filter = (IRelationPredicateBucket)frames.GetRelationInfo();
filter.PredicateExpression.Add( PredicateFactory.CompareValue(ProductVersionFieldIndex.ActiveState, ComparisonOperator.Equal, ProductManager.ACTIVE_STATE_ACTIVE ) );
filter.PredicateExpression.Add( PredicateFactory.CompareValue(CompanyFieldIndex.CompanyName, ComparisonOperator.Equal, manufacturer) );
filter.PredicateExpression.Add( PredicateFactory.CompareValue(RidingStyleFieldIndex.StyleGeneral, ComparisonOperator.Equal, styleGeneral) );
// Get fields and apply SUM() and Group By clause.
ResultsetFields fields = (ResultsetFields)frames.GetFieldsInfo();
fields["RPPrice"].AggregateFunctionToApply = AggregateFunction.Min;
fields["MfrGrams"].AggregateFunctionToApply = AggregateFunction.Min;
IGroupByCollection groupBy = new GroupByCollection();
for(int i = 0; i < fields.Count; i++)
{
IEntityField2 field = fields[i] as IEntityField2;
if ( field.AggregateFunctionToApply == AggregateFunction.None )
groupBy.Add( field );
}
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchTypedList( fields, frames, filter, 0, null, false, groupBy );
return frames;
}