0

i use this code for read mails.

 Lazy<AE.Net.Mail.MailMessage>[] messages = ic.SearchMessages(mailcondition, headersOnly);

Each message has a property called Value, and each value has its own properties, including UID.

Now I'm going to arrange the messages based on the UID.

please guide me

Miss
  • 171
  • 1
  • 4
  • 10

1 Answers1

0

You need to use following.

messages.OrderBy(x=>x.Value.Value.UID)

Since messages are Lazy<MailMessage>, messages[x].Value would give you a MailMessage instance. Hence to access UID, you need to use messages[x].Value.Value.UID.

Anu Viswan
  • 17,797
  • 2
  • 22
  • 51
  • Are you still using Lazy[] or are using IEnumerable ? If you are using Lazy, "x=>x.Value" would give you an instance of MailMessage and not MailMessage.Value – Anu Viswan Mar 04 '19 at 14:13