次のシリアル化可能なクラスがあります。
[Serializable]
public class EmailClass
{
public string from;
public List<string> To;
public List<string> CC;
public string DisplayTo;
public string Subject { get; set; }
public int attachments;
public List<string> attachmentsName;
public string DateTimeReceived;
public string DateTimeSent;
public string FinalFilename;
public string DatetimeCreated;
public string ExchangeUniqueId;
public string ChankeyID;
public string FinalFileName {get;set;}
public bool Encrypted;
public string Descripcion { get; set; }
}
ですから、リストがあり、Linq を使用してクエリを実行したいと考えています。
var query = from p in listado
where p.from.ToString().ToUpper() == textBox1.Text
そして問題は、p.from
を identifier からの linq として認識するため、受け入れられないことです。
エラー: 表現用語 'from' が無効です
ハードディスクに保存されているxmlオブジェクトをデシリアライズしているため、クラスパブリック文字列「from」を変更できません。
この問題を回避するにはどうすればよいですか?
List.FindAll などを使用できることはわかっていますが、linq を使用して実行できるかどうかを知りたいです。