public void UpdateEmailsStatus(int[] mailIDs, MailStatusType status)
 {
     foreach(var mailID in mailIDs)
     {
         var response = ExigoApiContext.CreateWebServiceContext().UpdateEmailStatus(new UpdateEmailStatusRequest
         {
             CustomerID = Identity.Current.CustomerID,
             MailID = mailID,
             MailStatusType = status
         });
     }
 }
    public List<int> GetAllEmailIDs(MailStatusType status, int folderID)
    {
        var query = ExigoApiContext.CreateODataContext().Emails
            .Where(c => c.CustomerID == Identity.Current.CustomerID)
            .Where(c => c.MailStatusTypeID == (int)status)
            .Where(c => c.MailFolderID == folderID)
            .Select(c => new 
            {
                c.MailID
            })
            .ToList();

        var list = new List<int>();
        list = query.Select(c => c.MailID).ToList();

        return list;
    }