Hello Henk, I've having a problem on "left" and "inner" joins on MultiMap, it's always returning a inner join and a need a left join on my query.
here is the code.
{
using (var db = new NpgsqlConnection(ConnectionString))
{
var stationDictionary = new Dictionary<int, Station>();
var result = db.Get<Station, Package, Station>(id, (station, package) =>
{
Station stationEntry;
if (!stationDictionary.TryGetValue(station.Id, out stationEntry))
{
stationEntry = station;
stationEntry.Packages = new List<Package>();
stationDictionary.Add(id, stationEntry);
}
stationEntry.Packages.Add(package);
return stationEntry;
});
return result;
}
}
here is the entities
{
public int Id { get; set; }
public string Name { get; set; }
public string Desc { get; set; }
public ICollection<Package> Packages { get; set; } = new List<Package>();
}
public class Package
{
public int Id { get; set; }
public string Name { get; set; }
public string Desc { get; set; }
public int StationId { get; set; }
public Station Station { get; set; }
}
It always returning me a inner join, I needed to put a "?" in StationId on Package to get a left join.
probably i'm making some mistakes on my code, could you help me?
Hello Henk, I've having a problem on "left" and "inner" joins on MultiMap, it's always returning a inner join and a need a left join on my query.
here is the code.
here is the entities
here is the maps
It always returning me a inner join, I needed to put a "?" in StationId on Package to get a left join. probably i'm making some mistakes on my code, could you help me?
Thanks and keep with the great work :)