I\'m trying to transform some data selected out of a repository using Linq.
My code so far:
Repository _repository = new Repository<
Not sure why your first example does not run, it looks Ok, see related question here. Possibly it might be a bug in your db driver ?
You could try using GroupBy to achieve the same result:
var disciplines = _repository.Query()
.GroupBy(d => new Discipline
{
DisciplineCode = d.DisciplineCode,
Name = d.DisciplineName
}
)
.ToList();