How to assign one object to another in Linq c# without making new

Posted by LLL on Stack Overflow See other posts from Stack Overflow or by LLL
Published on 2012-10-26T04:57:13Z Indexed on 2012/10/26 5:00 UTC
Read the original article Hit count: 115

Filed under:
|
|
|

I m facing issue in assiging one object to another in linq sql. In this example

  Func<result, result> make = q => new result
                {
                    Id = q.Id,
                    lName = q.lName,
                    GroupId = q.GroupId,
                    Age = (from tags in q.age where tags.Del == null && tags.lId == q.Id select age).ToEntitySet(),

                };


                p = (from q in dc.results
                     where q.Id == Id.Value
                     select make(q)).First();

i am making new and assigning the object, but i dont want to do this, it will cause propblem in insertion. so i want to assign without making new, how is it possible?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql