public async Task ExecuteAsync(DeleteModelCommand command) { var model = await ModelsDao.FindAsync(command.Id); if (model == null) { throw new ArgumentException($"{typeof(TModel).Name} with given Id not found"); } ModelsDao.Remove(model); await SaveAsync(); }
public void Execute(DeleteModelCommand command) { var model = ModelsDao.Find(command.Id); if (model == null) { throw new ArgumentException($"{typeof(TModel).Name} with given Id not found"); } ModelsDao.Remove(model); Save(); }