Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Return type for Linq Query

$
0
0

I have a service where by i would like to call the function below. And for the life of me I cant work out what the correct return type should be.
I DONT want to create a object class that has the the properties below and have that as the return type. Ideally i would like to convert to a list and return the a dynamic / generic list. I dont know how to do that. Can someone advise please!

public  List<Object> getR(int type)
        {
            var db = new entities();

            var reqs = from r in db.r select r;

            dynamic qry = (from r in reqs
                select new
                {
                    cName = r.cName,
                    rID = r.reqID,
                    uID = r.rrID,
                    reqDate = r.rDate,
                    re = r.une,
                    ca = r.cd,
                    arId = r.arId,
                    a = r.approved

                }).ToList();

            return qry;

        }


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>