public void Login() { Assert.True(_db.IsExists(_ac)); Assert.True(_db.Remove(_ac)); Assert.False(_db.IsExists(_ac)); Assert.False(_db.Remove(_ac)); }
public async Task <IActionResult> DeleteQuestion(Guid questionID) { if (questionID != Guid.Empty) { try { var questionDetails = await _accountCtx.ViolationQuestions.SingleOrDefaultAsync(a => a.Id == questionID); if (questionDetails.CreateUserId == User.GetLoggedInUserId().Value) { _accountCtx.Remove(questionDetails); await _accountCtx.SaveChangesAsync(); return(Json("1")); } } catch (Exception ex) { throw ex; } } return(Json("")); }
public Account DeleteItem(int accountId) { _context.Remove(accountId); return(new Account()); }