A
A
Artyom Pletnev2014-01-10 11:53:05
LINQ
Artyom Pletnev, 2014-01-10 11:53:05

LINQ, GTOUP BY. How to choose a group with the maximum characteristic?

var modelData = (from data in сontext...
                    join ...
                    join ...
                    where ...
                    group new {a, b, c } by
                        new {d, e, f, Date}
                    into groups
                    where Выбрать ту группу у которой максимальная дата
                    select 
                           new T
                           {
                              ...
                           }

                    ).ToList();

You must select the group with the maximum date. Something has really bugged me, please help me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SanSYS, 2014-01-10
@SanSYS

Order by desc date
Take (1)
but probably it will be more convenient outside of linq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question