Наследование: INotificationRepository, IDisposable
 public bool RemoveExistingAccount(string rowKey)
 {
     bool retVal = false;
     using (INotificationRepository rep = new NotificationRepository())
     {
         retVal = rep.Delete(rowKey);
         rep.SaveChanges();
     }
     return retVal;
 }
Пример #2
0
 public static void SendBillNotifications()
 {
     using (INotificationRepository rep = new NotificationRepository())
     {
         var notifications = rep.List();
         foreach (var n in notifications)
         {
             GetBillAndSendNotification(n);
         }
     }
 }
 public string Post(Notification notification)
 {
     string retVal = string.Empty;
     notification.PartitionKey = "partitionName";
     using (INotificationRepository rep = new NotificationRepository())
     {
         rep.AddOrUpdate(notification);
         rep.SaveChanges();
         retVal = notification.RowKey;
     }
     return retVal;
 }
 public string GetExistingUsername(string rowKey, string notificationUri)
 {
     string retVal = string.Empty;
     using (INotificationRepository rep = new NotificationRepository())
     {
         Notification notification = rep.GetByRowKey(rowKey);
         if (notification != null)
         {
             retVal = notification.UserName;
             notification.NotificationUri = notificationUri;
             notification.LastVerification = DateTime.UtcNow;
             rep.Update(notification);
             rep.SaveChanges();
         }
     }
     return retVal;
 }