Hopefully this is a easy question, i tried to do what i cound do on my own. But i can't solve the rest part.
Out for every row, i want to check if the date is heigher or lower equels to the last. But how?
As you can see yon on the image and the sample code.
Click and see the image exsample
And the following code:
@using Scoutpocket.Models.Database;
@model Tuple<List<Properties>, List<SubProperties>, List<Rating>>
<div class="container">
@foreach (var item in Model.Item1)
{
<br />
<br />
<b>
@item.PropertiesName
</b>
<br />
foreach (var item2 in item.SubProperties)
{
@item2.SubPropertiesName<br />
int count = 2;
int getLast = 1;
foreach (var item3 in item2.rating.Where(x => x.PlayerID == 1).Take(count).OrderByDescending(x => x.Date))
{
for (int i = 0; i < getLast; i++)
{
// Check the index of the last row, and check if the current date is lower or heighter.
<b>Compare date on last and newst</b>
}
<span>Rating ID: @item3.RatingID</span>
<span> | </span>
<span>Value: @item3.Value</span>
<span> | </span>
<span>ScoutID: @item3.ScoutID</span>
<span> | </span>
<span>PlayerID: @item3.PlayerID</span>
<span> | </span>
<span>Date: @item3.Date</span>
<br/>
}
}
}
</div>