Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Pass LINQ object form Biz Class
Message
From
06/07/2010 11:46:32
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
06/07/2010 11:35:59
General information
Forum:
ASP.NET
Category:
LINQ
Miscellaneous
Thread ID:
01471528
Message ID:
01471533
Views:
58
I get a new error.
Using the generic type 'System.Collections.Generic.IEnumerable<T> ' requires 1 type arguments	
>Guessing here:
>
>What happens if you make the return type IEnumerable instead of Enumerable?
>
>>Hi All
>>I have the class below that I want to use to data from my EF setup. I can't figure out what type to make the method so I can return the resulting LINQ object. The code below gives me this error.
>>
>>Cannot implicitly convert type 'System.Collections.Generic.IEnumerable AnonymousType#1 to 'System.Linq.Enumerable'
>>
>>Thanks.
>>
>>
>>    public class MyBizClass   
>>    {
>>        private CornMazeYellowPagesEntities oEFobject = null;
>>        public MyBizClass()
>>        {
>>            this.oEFobject = new CornMazeYellowPagesEntities();
>>        }
>>
>>        public Enumerable getDirectory()
>>        {
>>            //CornMazeYellowPagesEntities queryobj = null;
>>            var queryobj = from dr in this.oEFobject.DIRECTORies.AsEnumerable()
>>                        select new
>>                        {
>>                            dr.ADDRESS1,
>>                            dr.ADDRESS2,
>>                            dr.CITY,
>>                            dr.COMPANYNAME
>>                        };
>>
>>            //queryobj = 
>>             //    from dr in this.oEFobject.DIRECTORies 
>>             //           select dr;
>>
>>            return queryobj;
>>        }
>>    }
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform