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
Post a Comment