This is my tables definition :
Ticket
-------------------------------
|ID int PK |
|Paid varchar(50) |
-------------------------------
TicketRow
----------------------------------
|ID int PK |
|TicketID_FK int |
|SHtimeID_FK int |
----------------------------------
And this is my sql query :
select SHtimeID_FK,count(*) as cnt
from dbo.TicketRow as tr inner join dbo.Ticket as t on tr.TicketID_FK=t.ID
where t.Paid='ok'
group by SHtimeID_FK
having count(*)>1
How should i convert this query to a Linq query?
UPDATE :
I try this query but i don't know how should i complete my query !
MelliConcertEntities db = new MelliConcertEntities();
var s = (from x in db.TicketRow
where x.Ticket.Paid == "ok"
select x).GroupBy(???);