c# - Return Tuple from EF select -


how can retrieve tuples @ select using ef4?

        var productcount = (from product in context.products                     select new tuple<product, int>(product, products.orders.count)); 

or

        var productcount = (from product in context.products                     select tuple.create(product, products.orders.count)); 

entity framework says cant use not empty constructor first case, , not recognize tuple.create method second.

how switching linq-to-objects projection:

var productcount = product in context.products                 select new {product = product, count = products.orders.count }; var final = item in productcount.asenumerable()             select tuple.create(item.product, item.count); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -