I posted up part of some code the other day but in doing so caused more confusion. This is my code.
if ( HttpContext.Current.Session != null )
{
if ( HttpContext.Current.Session[ "CurrentLabourTransactions" ] != null )
{
Collection<JCTransLabour> oJCTransLabours = null;
oJCTransLabours = (Collection<JCTransLabour>)HttpContext.Current.Session["CurrentLabourTransactions"];
if (Settings.ShowTodaysTransactionInApproval)
if (oJCTransLabours != null) return oJCTransLabours;
if (oJCTransLabours != null)
{
//oJCtransLabour contains alot of record
var oCurrentLabourTrans = (from clt in oJCTransLabours
where clt.TransactionDate.Date != DateTime.UtcNow
select clt);
//oCurrentLabourTrans is null.
return oCurrentLabourTrans as Collection<JCTransLabour>;
}
}
}
return null;
When going into the final if statement there are a lot of transactions with different dates. It seems to although it always returns null records.
Thanks in advance for any help.