public void RemoveKey(string bucket, string handle) { using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { var association = dataContext.SymmetricCryptoKeys.FirstOrDefault(a => a.Bucket == bucket && a.Handle == handle); if (association != null) { dataContext.DeleteObject(association); } else { } } }
/// <summary> /// Removes a specified handle that may exist in the store. /// </summary> /// <param name="distinguishingFactor">The Uri (for relying parties) or Smart/Dumb (for Providers).</param> /// <param name="handle">The handle of the specific association that must be deleted.</param> /// <returns> /// True if the association existed in this store previous to this call. /// </returns> /// <remarks> /// No exception should be thrown if the association does not exist in the store /// before this call. /// </remarks> public bool RemoveAssociation(Uri distinguishingFactor, string handle) { using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { var association = dataContext.OpenIdAssociations.FirstOrDefault(a => a.DistinguishingFactor == distinguishingFactor.AbsoluteUri && a.AssociationHandle == handle); if (association != null) { dataContext.DeleteObject(association); return(true); } else { return(false); } } }
/// <summary> /// Removes a specified handle that may exist in the store. /// </summary> /// <param name="distinguishingFactor">The Uri (for relying parties) or Smart/Dumb (for Providers).</param> /// <param name="handle">The handle of the specific association that must be deleted.</param> /// <returns> /// True if the association existed in this store previous to this call. /// </returns> /// <remarks> /// No exception should be thrown if the association does not exist in the store /// before this call. /// </remarks> public bool RemoveAssociation(Uri distinguishingFactor, string handle) { using (var dataContext = new TransactedDatabaseEntities(System.Data.IsolationLevel.ReadCommitted)) { var association = dataContext.OpenIdAssociations.FirstOrDefault(a => a.DistinguishingFactor == distinguishingFactor.AbsoluteUri && a.AssociationHandle == handle); if (association != null) { dataContext.DeleteObject(association); return true; } else { return false; } } }