Something like this should work:
using (var db = new EntityContext())
{
return db.Entity.GroupJoin(
db.EntityPoints.Where(p => p.QId == 2),
entity => entity.EntityId,
point => point.EntityId,
(entity, points) => new
{
entity,
point = points.FirstOrDefault()
})
.Select(m => new TestModel
{
pointGEID = m.entity.EntityId,
PointGE_name = m.entity.Name,
Points = (m.point == null) ? default(int?) : m.point.Points
})
.ToList();
}
Queryable.GroupJoin method (MSDN)[
^]
How to: Perform Left Outer Joins (C# Programming Guide)[
^]