除了在 asp.net MVC 中具有实体框架的两个 table 之间
Except between two table with entity freamwork in asp.net MVC
我有三个 table A , B , C;
//Table A
public class Question
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
}
//Table B
public class Answer
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
[Required]
public int QusetionID { get; set; }
[Required]
public int LocalID { get; set; }
}
//Table C
public class Local
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
[Required]
public int Localip { get; set; }
}
当地人没有回答的问题是什么?
你如何使用 except 在两个矩阵中使用?
使用 Entity Framework 在 Asp.net MVC 中
我想显示未回答的问题列表?
string ip = Request.UserHostAddress;
var answerip = db.Answer.Where(l => l.Local.Localip == ip );
var quslist = db.Qustions.Except(answerip);
List<int> tempIdList = answeripE.Select(q => q.ID).ToList();
var quslist = db.Qustion.Where(q => !tempIdList.Contains(q.ID));
感谢"daryal"的创造者
Get All Except from SQL database using Entity Framework
我有三个 table A , B , C;
//Table A
public class Question
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
}
//Table B
public class Answer
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
[Required]
public int QusetionID { get; set; }
[Required]
public int LocalID { get; set; }
}
//Table C
public class Local
{
[Key]
public int ID { get; set; }
[Required]
public string Name { get; set; }
[Required]
public int Localip { get; set; }
}
当地人没有回答的问题是什么? 你如何使用 except 在两个矩阵中使用? 使用 Entity Framework 在 Asp.net MVC 中 我想显示未回答的问题列表?
string ip = Request.UserHostAddress;
var answerip = db.Answer.Where(l => l.Local.Localip == ip );
var quslist = db.Qustions.Except(answerip);
List<int> tempIdList = answeripE.Select(q => q.ID).ToList();
var quslist = db.Qustion.Where(q => !tempIdList.Contains(q.ID));
感谢"daryal"的创造者 Get All Except from SQL database using Entity Framework