0

I have below-mentioned list foo which contains the volume data for Pacific daylight time, If I want to see the volume in mountain standard time I am trying to move the list items based on the difference of time between 2 time zones

Let's say the difference is 3 hours I expect the result to be

B1Volume = B4Volume;
B2Volume = B5Volume;
...................
B21Volume = B24Volume;

var foo = new List<XYZ>();

public class XYZ
{
    public String TimeZone { get; set; }
    public Decimal? B1Volume { get; set; }
    public Decimal? B2Volume { get; set; }
    public Decimal? B3Volume { get; set; }
    public Decimal? B4Volume { get; set; }
    public Decimal? B5Volume { get; set; }
    // .............
    // .............
    public Decimal? B24Volume { get; set; }
}

Am trying to follow Generic List - moving an item within the list

Rufus L
  • 36,127
  • 5
  • 30
  • 43
mahesh
  • 3,067
  • 16
  • 69
  • 127
  • In your example (increase by 3), what would be the values of B22 - B24? – Rufus L Oct 31 '17 at 20:10
  • It appears this question has nothing to do with moving list items, but rather adjusting property values of class instances based on some other value. – Rufus L Oct 31 '17 at 20:14
  • @Rufus L B22Volume = B1Volume – mahesh Oct 31 '17 at 20:16
  • @RufusL Thanks for the reply , how do I adjust property values of class instances based on the while ? Please provide example – mahesh Oct 31 '17 at 20:20
  • 1
    Is it possible to store the volumes in a `List Volumes` property instead of individually named properties? That would make it pretty easy. – Rufus L Oct 31 '17 at 20:26
  • @RufusL class xyz has more than 50 properties with different data types , Even I agree if it was List that would have made easy – mahesh Oct 31 '17 at 20:31
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/157950/discussion-between-mahesh-and-rufus-l). – mahesh Oct 31 '17 at 20:55

0 Answers0