Exemplo n.º 1
0
 /// <summary>
 /// Return the list of all the accounts that need to be monitored
 /// </summary>
 /// <returns></returns>
 public static List <ImapAccount> GetActiveAccounts()
 {
     using (var db = new ConfigurationDb())
     {
         var activeAccounts = db.ImapAccounts.Where(a => a.IsActive).ToList();
         return(activeAccounts);
     }
 }
Exemplo n.º 2
0
        public static void UpdateAccountLastUid(int accountId, int uid)
        {
            using (var db = new ConfigurationDb())
            {
                var acc = db.ImapAccounts.SingleOrDefault(a => a.Id == accountId);

                if (acc == null || acc.LastUid >= uid)
                {
                    return;
                }

                acc.LastUid = uid;
                db.SaveChanges();
            }
        }