如何使用 LINQ 搜索 GoToWebinar 注册者列表
本文关键字:注册 列表 GoToWebinar 搜索 何使用 LINQ | 更新日期: 2023-09-27 17:56:53
我在C#中有下面的类。我调用 GoToWebinar API 函数来获取网络研讨会的注册者列表。它返回一个列表
public class ResponseWebinarAttendees
{
// Will only be using the joinUrl but need to have all the data points, just in case
[DataMember(Name = "type")]
public string type { get; set; }
[DataMember(Name = "timeZone")]
public string timeZone { get; set; }
[DataMember(Name = "status")]
public string status { get; set; }
[DataMember(Name = "firstName")]
public string firstName { get; set; }
[DataMember(Name = "lastName")]
public string lastName { get; set; }
[DataMember(Name = "email")]
public string email { get; set; }
[DataMember(Name = "registrantKey")]
public string registrantKey { get; set; }
[DataMember(Name = "registrationDate")]
public string registrationDate { get; set; }
[DataMember(Name = "attendeeId")]
public string attendeeId { get; set; }
[DataMember(Name = "joinUrl")]
public string joinUrl { get; set; }
}
是否可以使用 LINQ 在列表中搜索具有特定电子邮件地址的注册者?
如果你有一个集合,你可以内联任意数量的 OR |.Where()
方法中的 AND 子句。
var filteredResult = attendees.Where(x => x.email == "email@email.com" ||
x.email == "email2@email.com");