如果在第一个数组中找不到第二个数组中的所有值,则需要删除它们中的所有值。但是,我在C#中找不到在线命令。尽管我已经为其他语言找到了它。如果在MVC中的第二个数组中找不到,则从第一个数组中删除
这是我的第一个数组:
string[] EmailList = (from user in db.Users join subscribor in Subscribors on user.UserId equals subscribor orderby user.FirstName select user.EmailAddress).ToArray();
和我的第二个数组:
string[] TechList = (from user in db.Users join tech in techs on user.UserId equals tech select user.EmailAddress).ToArray();
,这是我试过的代码:
EmailList = EmailList.Intersect(TechList);
我也尝试了几个相交的其他变体,但没有任何作用。在这行代码我收到以下错误:
cannot emplicitly converty type 'system.collections.generic.IEnumerable to string[]