Exemple #1
0
        public virtual void Delete(object id, bool autoSave = true)
        {
            TEntity entity = _repository.FindById(id);

            _repository.Delete(entity, autoSave);
            _memoryCacheManager.Clear();

            //TO-DO: Log
        }
 public IActionResult Delete(int id)
 {
     try
     {
         return(Ok(_repository.Delete(id)));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex));
     }
 }
        public virtual void Delete(object id, bool autoSave = true)
        {
            TEntity entity = _repository.FindById(id);

            //Prevalidacion
            _validator.PreDelete(entity);

            _repository.Delete(entity, autoSave);

            //PostValidacion
            _validator.PostDelete(entity);

            _memoryCacheManager.Clear();

            //TO-DO: Log
        }