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:

here is powershell script on how to get list of files from changesets associated with one tfs task

$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...