public T Delete(string id) { _cache?.Delete(id); var result = Get(id); if (result == null) { return(null); } _lite.Delete(m => m.Id == id); return(result); }
public virtual T Delete(T model) { try { if (model == null) { return(null); } _cache?.Delete(model.Id.ToString()); _dbSet.Remove(model); _db.SaveChanges(); _log.Delete(model); return(model); } catch (Exception ext) { _log.CatchError(ext.Message, 0, model, ext, "Delete", null); throw; } }