コード例 #1
0
        public bool DeleteAsync(int id)
        {
            if (id <= 0)
            {
                throw new ArgumentException("id错误");
            }

            return(_schoolRepository.DeleteAsync(id));
        }
コード例 #2
0
        public async Task <IActionResult> DeleteHomeWork(int id)
        {
            var entity = await _schoolRepository.DeleteAsync(id);

            if (!entity)
            {
                return(NotFound(new { error = "Invalid Id" }));
            }
            return(Ok());
        }
コード例 #3
0
 public async Task DeleteAsync(Guid id)
 {
     await _repository.DeleteAsync(id);
 }