TimeSheetData timesheetdata = new TimeSheetData();
TimeSheet timeSheet = new TimeSheet();
TimeSheetData timesheetdata = new TimeSheetData();
timeSheet.StartDate = thisWeekStart;
timeSheet.EndDate = thisWeekEnd;
timesheetdata.Date = dt;
string HourData = item.Value;
string TaskID = item.ID.Split(':')[0];
timesheetdata.TaskID = Guid.Parse(TaskID);
timesheetdata.TimeSheet = timeSheet;
timesheetdata.Hours = Convert.ToDouble(HourData);
db.TimesheetData.Add(timesheetdata);
db.SaveChanges();
var TMS = db.TimeSheets.Where(t => t.StartDate == thisWeekStart
&& t.EndDate == thisWeekEnd).ToList();
我的表是:
Timesheets
(Guid,Startdate,Enddate)TimeSheetDatas
(Guid,小时,日期,任务GUID,时间表指南)我想在TimesheetDatas
和StartDate
(EndDate
)之间找到小时(Timesheets
)。
Hours find = var TMS
答案 0 :(得分:0)
你没有提供一些细节,但是你想要这样的东西;
var query = from ts in db.TimeSheets
join tsd in db.TimesheetDatas on ts.Guid equals tsd.TimesheetGuid
where ts.StartDate > thisWeekStart && ts.StartDate < thisWeekEnd
select tsd.hour