示例#1
0
        public ActionResult Delete(Guid id)
        {
            var result = _bo.Delete(id);

            if (result.Success)
            {
                return(Ok());
            }
            return(new ObjectResult(HttpStatusCode.InternalServerError));
        }
        public ActionResult Delete(Guid id)
        {
            var result = _bo.Delete(id);

            if (result.Success)
            {
                return(Ok());
            }
            return(InternalServerError());
        }
示例#3
0
        public void TestDeleteMenu()
        {
            RestaurantSeeder.Seed();
            var bo        = new MenuBusinessObject();
            var resList   = bo.List();
            var total     = resList.Result.Count;
            var resDelete = bo.Delete(resList.Result.First().Id);

            resList = bo.ListNonDeleted();
            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == total - 1);
        }
示例#4
0
        public void TestDeleteMenu()
        {
            ContextSeeders.Seed();
            var bo = new MenuBusinessObject();

            var resList   = bo.List();
            var resDelete = bo.Delete(resList.Result.First().Id);

            resList = bo.List();

            Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.First().IsDeleted);
        }
示例#5
0
        public ActionResult Delete(Guid id)
        {
            var res = _bo.Delete(id);

            if (res.Success)
            {
                return(Ok());
            }
            else
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }