How to use unlinked result of linq?

Posted by user46503 on Stack Overflow See other posts from Stack Overflow or by user46503
Published on 2010-04-05T23:53:01Z Indexed on 2010/04/06 0:03 UTC
Read the original article Hit count: 150

Filed under:
|

Hello, for example I'm trying to get the data from database like:

using (ExplorerDataContext context = new ExplorerDataContext())
        {
            ObjectQuery<Store> stores = context.Store;
            ObjectQuery<ProductPrice> productPrice = context.ProductPrice;
            ObjectQuery<Product> products = context.Product;
            res =
                from store in stores
                join pp in productPrice
                on store equals pp.Store
                join prod in products
                on pp.Product equals prod
                select store;
        }

After this code I cannot transfer the result to some another method because the context doesn't exist more. How could I get the unlinked result independent on the context? Thanks

© Stack Overflow or respective owner

Related posts about ADO.NET

Related posts about .NET