locked
How to use MAX in subquery in LINQ RRS feed

  • Question

  • I want to convert  following query into LINQ

    select Provider.id,ProviderSubscription.Id,Provider.CPersonName,ProviderSubscription.StartDate from  Provider 
    inner  join ProviderSubscription on 
    Provider.id=ProviderSubscription.providerID
    AND ProviderSubscription.Id=(SELECT max(id)from ProviderSubscription where ProviderSubscription.ProviderId=Provider.id)

     I need help in this.

    Thanks

     
    Wednesday, September 16, 2015 8:30 AM

All replies

  • Hi sam_kashif,

    There's a tool called Linqer, you could use this tool to convert your SQL query in LINQ and vice versa. Personally I use this tool for any LINQ operation. Though its only 30 days trial period after that you have to buy the licence key to continue. There is also free one called LINQpad, though its not as good as Linqer. Hope this helps you.

    Thanks,

    Sabah Shariq


    Wednesday, September 16, 2015 3:35 PM