score:31

Accepted answer
list<fillstruct> origlist = ...
list<newfillstruct> newlist = origlist.select(x => new newfillstruct {
    numlong = x.buy - x.sell, date = x.date
}).tolist();

however, note that struct is not necessarily a good choice for this (prefer class unless you have a good reason).

or to avoid linq entirely:

list<newfillstruct> newlist = origlist.convertall(x => new newfillstruct {
    numlong = x.buy - x.sell, date = x.date
});

score:4

this will select all your data from the enumerable "fillstructs" and create an enumerable of "newfillstruct" containing the calculated values.

 var newfills = from fillstruct in fillstructs
               select new newfillstruct
               {
                   numlong = fillstruct.buy - fillstruct.sell,
                   date = fillstruct.date
               };

Related Query

More Query from same tag