如果我有像这样的模型类
[Table("MTag")]
public class Tag
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int TagId { get; set; }
public string TagLabel { get; set; }
public virtual ICollection<TagRef> RefTags { get; set; }
}
[Table("TagRef")]
public class TagRef
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int TagRefId { get; set; }
public virtual Tag Tag { get; set; }
public virtual ICollection<Post> Posts { get; set; }
}
[Table("Post")]
public class Post
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int PostId { get; set; }
public UserProfile User { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string PostGuid { get; set; }
public string Make { get; set; }
public string Model { get; set; }
public virtual ICollection<MTagRef> Tags { get; set; }
public string ImageFileName { get; set; }
public int Price { get; set; }
public int ImageWidth { get; set; }
public int ImageHeight { get; set; }
}
选择所有匹配帖子的可能查询是什么?您能否提示一下,如果我有 Car、Mobile 等标签,如何设置查询?