Wednesday

linq subquery for in

for example following sql

select * from AccountTransactions a
where
a.TransactionId =19687 OR
a.TransactionId in (select ChildId from AccountTransactionRelations where InvoiceId=19687)


will have this equivalent in linq:

var records = from t in odc.AccountTransactions
join r in odc.AccountTransactionRelations on t.TransactionId equals r.InvoiceId into rel
where t.TransactionId == transactionId || rel.Select(o => o.ChildId).Contains(transactionId)
select t;



No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...