Linq使用Sql in的語法

來源參考:Stackoverflow

1. 

var Ids = {12, 32, 42}
var prod =db.Member.Where(x=> Ids .Contains(x.Ids));

 

2.

db.Member.Where(x => new[] { "Admin", "User" }.Contains(x.User));