Skip to content

Commit

Permalink
Left join when foreign key property is nullable - fixes #27.
Browse files Browse the repository at this point in the history
  • Loading branch information
henkmollema committed Apr 2, 2015
1 parent a86e9d0 commit fdb991d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Dommel/DommelMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ private static IEnumerable<TReturn> MultiMap<T1, T2, T3, T4, T5, T6, T7, TReturn
var includeKeyColumnName = Resolvers.Column(includeKeyProperty);
var foreignKeyProperty = Resolvers.ForeignKeyProperty(type, includeType);

sql += string.Format(" inner join {0} on {1}.{2} = {0}.{3}",
sql += string.Format(" {0} join {1} on {2}.{3} = {1}.{4}",
Nullable.GetUnderlyingType(foreignKeyProperty.PropertyType) != null
? "left"
: "inner",
includeTableName,
tableName,
foreignKeyProperty.Name,
Expand Down

0 comments on commit fdb991d

Please sign in to comment.