c# - Pull 14 Records From One List to Another -
i have following lists created below. rsicalclist populated want need pull first 15 skipping first item rsicalclist firstrsicalculationhistinfo. have attached attempt comes error. have attached error below. guidance on how achieve goal
private class rsicalclist { public string rsicalcsymbol { get; set; } public datetime rsicalcdate { get; set; } public decimal rsicalcclosechange { get; set; } } private class firstrsicalculationhistinfo { public string firstrsisymbol { get; set; } public datetime firstrsicalcdate { get; set; } public decimal firstrsiclosechange { get; set; } } irstrsihistinfo = rsicalclist .select(x => new firstrsicalculationhistinfo { firstrsisymbol = x.rsicalcsymbol, firstrsicalcdate = x.rsicalcdate, firstrsiclosechange = x.rsicalcclosechange }) .orderby(x => x.firstrsiclosechange) .skip(1) .take(15);
error
error cs0266 cannot implicitly convert type 'system.collections.generic.ienumerable<aftertrade.relativestrengthindex.firstrsicalculationhistinfo>' 'system.collections.generic.list<aftertrade.relativestrengthindex.firstrsicalculationhistinfo>'. explicit conversion exists (are missing cast?) aftertrade c:\users\\documents\projects\stockton\development\aftertrade\relativestrengthindex.cs 86 active
resolve query .tolist()
.
irstrsihistinfo = rsicalclist .select(x => new firstrsicalculationhistinfo { firstrsisymbol = x.rsicalcsymbol, firstrsicalcdate = x.rsicalcdate, firstrsiclosechange = x.rsicalcclosechange }) .orderby(x => x.firstrsiclosechange) .skip(1) .take(15) .tolist();
Comments
Post a Comment