AzureTicker.Worker.Model.Repositories.NotificationRepository.Delete C# (CSharp) Method

Delete() public method

public Delete ( string rowKey ) : bool
rowKey string
return bool
        public bool Delete(string rowKey)
        {
            var existingNotification = GetByRowKey(rowKey);
            if (existingNotification != null)
            {
                context.DeleteObject(existingNotification);
                return true;
            }
            else
                return false;
        }

Usage Example

 public bool RemoveExistingAccount(string rowKey)
 {
     bool retVal = false;
     using (INotificationRepository rep = new NotificationRepository())
     {
         retVal = rep.Delete(rowKey);
         rep.SaveChanges();
     }
     return retVal;
 }