Example #1
0
        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();
        }
Example #2
0
        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();
        }