C# 使用2个表删除连接和位置
我有两张桌子C# 使用2个表删除连接和位置,c#,subsonic,subsonic3,delete-record,C#,Subsonic,Subsonic3,Delete Record,我有两张桌子 POST (idpost, user, text) COMMENT (idcomment, idpost, text) 我想删除所有带有用户“usertest”的帖子评论 如何在亚音速3中实现这一点 我试过类似的方法,但是,当然,它不起作用 COMMENT.Delete(x => x.POST.where(y => y.user == "usertest")); 我不是亚音速程序员,但StackOverflow中还有一篇关于删除表中所有记录的文章: 这似乎是一个很
POST (idpost, user, text)
COMMENT (idcomment, idpost, text)
我想删除所有带有用户“usertest”的帖子评论
如何在亚音速3中实现这一点
我试过类似的方法,但是,当然,它不起作用
COMMENT.Delete(x => x.POST.where(y => y.user == "usertest"));
我不是亚音速程序员,但StackOverflow中还有一篇关于删除表中所有记录的文章:
这似乎是一个很好的起点,但这只是一个猜测。我不是亚音速程序员,但StackOverflow中还有一篇关于删除表中所有记录的文章:
这似乎是一个很好的起点,但这只是一个猜测。您应该能够做到以下几点:
IQueryable<Person> query = from comments in Comment.All()
join posts in Post.All()
on posts.idpost equals comment.idpost
select comments;
Comment.GetRepo().Delete(query.ToList());
IQueryable query=来自Comment.All()中的注释
在Post.All()中加入Post
在posts.idpost上等于comment.idpost
选择评论;
Comment.GetRepo().Delete(query.ToList());
您应该能够执行以下操作:
IQueryable<Person> query = from comments in Comment.All()
join posts in Post.All()
on posts.idpost equals comment.idpost
select comments;
Comment.GetRepo().Delete(query.ToList());
IQueryable query=来自Comment.All()中的注释
在Post.All()中加入Post
在posts.idpost上等于comment.idpost
选择评论;
Comment.GetRepo().Delete(query.ToList());