我们正在尝试在显示弹出消息之前检查方案。下面的代码在Visual Studio中运行良好,但在发布后不适用于Azure。两者都指向相同的Azure SQL数据库。
PTO objPTOExist = db.PTOes.Where(p =>
(p.UserId == model.UserId && p.StartDate <= model.StartDate && model.StartDate <= p.EndDate && p.PTOId != model.PTOId)
|| (p.UserId == model.UserId && p.StartDate <= model.EndDate && model.EndDate <= p.EndDate && p.PTOId != model.PTOId)
|| (p.UserId == model.UserId && model.StartDate <= p.StartDate && p.StartDate <= model.EndDate && p.PTOId != model.PTOId)
|| (p.UserId == model.UserId && model.StartDate <= p.EndDate && p.EndDate <= model.EndDate && p.PTOId != model.PTOId)
|| (p.Name == "Holiday" && p.StartDate <= model.StartDate && model.StartDate <= p.EndDate && p.PTOId != model.PTOId)
|| (p.Name == "Holiday" && p.StartDate <= model.EndDate && model.EndDate <= p.EndDate && p.PTOId != model.PTOId)
|| (p.Name == "Holiday" && model.StartDate <= p.StartDate && p.StartDate <= model.EndDate && p.PTOId != model.PTOId)
|| (p.Name == "Holiday" && model.StartDate <= p.EndDate && p.EndDate <= model.EndDate && p.PTOId != model.PTOId)
).FirstOrDefault();
我知道我可以使代码更简单,但即使它在本地工作,也会在Azure上产生不良结果。
感谢您对Azure的行为方式有所了解。