public void TestAddDeleteListAsync() { var list = new List { Name = "List PI Teste", BoardId = 1 }; _lr.Add(list); var addedlist = _lr.FindAllBy(l => l.Name == list.Name).FirstOrDefault(); Assert.IsNotNull(addedlist); List del = _lr.GetSingle(addedlist.ListId); _lr.Delete(del); Assert.AreEqual(0, _lr.FindAllBy(l2 => l2.Name == addedlist.Name).Count()); }
public ActionResult DeleteConfirmed(int id) { var list = _lr.GetSingle(id); _lr.Delete(list); return(RedirectToAction("ListsOfBoard", new { boardid = list.BoardId })); }
public /*async Task<*/ IHttpActionResult /*>*/ DeleteList(int id) { List list = _lr.GetSingle(id); //await _lr.List.FindAsync(id); if (list == null) { return(NotFound()); } //_lr.List.Remove(list); //await _lr.SaveChangesAsync(); _lr.Delete(list); return(Ok(list)); }