entity framework - LINQ: Join, group by, aggregate in VB.net -


i know has been answered dozen times in c#, i'm having difficulty finding simple solution in vb.net (everyone else doing multiple joins groups , other junk don't need , can't filter out solution).

essentially, i'm trying write following (simple) sql query linq on vb.net:

select a.id, a.first_name, a.last_name, [count] = count(b.id), last_payment = max(b.payment_date) members join payments b on a.id = b.member_id group a.id, a.first_name, a.last_name 

i've tried , got far, visual studio insists on screwing me on before can finish typing out

dim myresult = d in (from in db.members                 join b in db.payments on a.id equals b.member_id                 group b.payment_date a.id, a.first_name, a.last_name joke()'<< here vs insists supposed name of function, , forces me put these parenthesis no matter                 select id, first_name, last_name, count = joke.count(), last_payment = joke.max()) 

i can't let me start on "aggregate" portion i've read need max , count.

any hints on i'm going wrong? has frustrated me 2 hours simple...

found answer in

how use "into" linq expression in vb.net?

apparently need = group doesn't think it's function. :facepalm:


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -