Create an IEnumerable Queue from two IEnumerables

  • Thread starter Thread starter DoctorWhoKnew
  • Start date Start date
D

DoctorWhoKnew

Guest
I have two IEnumerables, stockDates and stockClosing, that I want to place in a queue.

IEnumerable<DateTime> stockDates = stocks.Select(equity => equity.Date);
IEnumerable<decimal> stockClosing = stocks.Select(equity => equity.Close);

// create a queue
Queue<MovingAverage> movingAverageQueue = new Queue<MovingAverage>();


How can I add stockDates and stockClosing into the newly created movingAverageQueue?

Here is the MovingAverage class:

namespace myBackEnd.Models
{
public class MovingAverage
{
public DateTime Date { get; set; }
public decimal Close { get; set; }

}
}




Continue reading...
 
Back
Top