Exemple #1
0
        /// <summary>
        /// Remove the specified entity from the data-store.
        /// </summary>
        /// <param name="entity">Entity.</param>
        /// <param name="token">A token with which the task may be cancelled.</param>
        /// <typeparam name="TEntity">The entity type.</typeparam>
        public Task RemoveAsync <TEntity>(TEntity entity, CancellationToken token = default(CancellationToken)) where TEntity : class, IEntity
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            return(persister.DeleteAsync(entity, entity.GetIdentity()?.Value, token));
        }
Exemple #2
0
 /// <summary>
 /// Deletes the specified item from the data-store.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="identity">The item's identity.</param>
 /// <param name="token">A token with which the task may be cancelled.</param>
 /// <typeparam name="T">The item type.</typeparam>
 public Task DeleteAsync <T>(T item, object identity, CancellationToken token = default(CancellationToken)) where T : class
 => wrapped.DeleteAsync(item, identity, token);