Example #1
0
        protected virtual void DeleteOnThread(IEnumerable <TModel> entityList, VoidReturnCallback callback)
        {
            ISession currentSession = Decorated.Session;

            Decorated.Session = Session;
            Decorated.Delete(entityList);
            callback();
            Decorated.Session = currentSession;
        }
Example #2
0
        protected virtual void DeleteOnThread(TModel entity, VoidReturnCallback callback)
        {
            ISession currentSession = Decorated.Session;

            Decorated.Session = Session;
            Decorated.Delete(entity);
            callback();
            Decorated.Session = currentSession;
        }
 public async Task <bool> Delete(Guid id)
 {
     try
     {
         Log.LogInformation("Trying to delete entity of {EntityType} with id '{Id}'", typeof(TEntity).Name, id);
         return(await Decorated.Delete(id));
     }
     catch (Exception e)
     {
         Log.LogError(e, "Exception when deleting entity with id '{Id}'", id);
         throw;
     }
 }
Example #4
0
 public virtual void Delete(IEnumerable <TModel> entityList)
 {
     Decorated.Delete(entityList);
 }
Example #5
0
 public virtual void Delete(TModel entity)
 {
     Decorated.Delete(entity);
 }
Example #6
0
        /// <summary>
        /// Permanently removes an existing document representing <see ref="T" /> from the repository by exposing the decorated method, and from the cache.
        /// </summary>
        /// <param name="guid">The globally unique identifier for the entity.</param>
        /// <returns>An asynchronous <see cref="Task{T}"/>.</returns>
        public async Task Delete(Guid guid)
        {
            await Decorated.Delete(guid).ConfigureAwait(false);

            MemoryCache.Remove(guid);
        }