I have a trying to select a record. In db, i have two records for Month 1 and 4.
I need to get values for both month 1 and 4, but all i get is value for month 1 both times in iteration (Month 1 and Month 4).
EX: In dB Month 1 Value is : 55 and Month 4 value is 22, but i get value 55 for both Months 1 and 4, while iteration in code.
for (var month = 1; month <= 12; month++)
{
var itemMonth = month;
var itemAuditReport = proxy.itemAuditReports.SingleOrDefault(i => i.SKU == itemSku && i.Month == itemMonth && i.Year==itemYear);
//
}
if (itemAuditReport == null)
{
// Do Something
}
Am i missing something ?