示例#1
0
        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());
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            var list = _lr.GetSingle(id);

            _lr.Delete(list);
            return(RedirectToAction("ListsOfBoard", new { boardid = list.BoardId }));
        }
示例#3
0
        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));
        }