I have module which is not mapped to database and is use to generate report.
public class Report
{
public int USERID { get; set; }
public DateTime DateToCal { get; set; }
public string Name { get; set; }
public string Position { get; set; }
public TimeSpan? Intime { get; set; }
public TimeSpan? OutTime { get; set; }
}
I generate a query and fill some properties(USERID, DateToCal, Name, Position, Intime) of report and remaining properties OutTime is null.
var query = .....;
Now what I want is foreach item of query( of type Report) set value for OutTime as
foreach(var items in query)
{
var outtime= from x in con.CHECKINOUTs
where x.USERID == items.USERID && EntityFunctions.TruncateTime(x.CHECKTIME) == EntityFunctions.TruncateTime(items.DateToCal && x.CHECKTYPE == "O"
select x.CHECKTIME
.Single();
items.OutTime= outtime.TimeOfDay;
}
Now problem is, on mousehover to items.OutTime
with in foreach there appear value but if I out from foreach and mousehover to query
there is still OutTime is null
. There not appear value what I set. Is this is possible to set value of entities such way. Or what is my problem?
Thank you.