LINQ get two records from each record -


i have list of objects of type:

myobject   .startdate   .enddate   .number 

for each object want return 2 objects of:

newobject   .date   .number 

in in 1 object date enddate , number. other object date startdate , number negative number

myobjects.selectmany(o => new[] {      new newobject { date = o.enddate, number = o.number },     new newobject { date = o.startdate, number = -o.number } } ); 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -