Usinq Linq to select items that is in a semi-comma separated string?

后端 未结 3 1404
孤城傲影
孤城傲影 2020-12-18 08:23

I have a string with semi-comma separated names:

string names = \"Jane;Harry\";

I also have a list of customer objects:

pub         


        
3条回答
  •  没有蜡笔的小新
    2020-12-18 08:50

    It Will Helps

    string allid = "11,12,13,14,15,16";
    string[] arrid = allid.Split(',');
    var data = context.MyModels.Where(x => arrid.Contains(x.ProjectId.ToString()));
    

提交回复
热议问题