public async Task When_DeletingModuleWithoutTutors_Expect_ModuleDeleted(int id) { await _modulesService.Delete(id); var actualModuleDeleted = await _context.Modules.FirstOrDefaultAsync(m => m.Id == id); Assert.Null(actualModuleDeleted); }
public async Task <IActionResult> DeleteModule(int id) { try { await _modulesService.Delete(id); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public Task <IResultModel> Delete([BindRequired] string id) { return(_service.Delete(id)); }