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()); }
public void TestDeleteCourseAsync() { RestaurantSeeder.Seed(); var bo = new CourseBusinessObject(); var resList = bo.ListAsync().Result; var total = resList.Result.Count; var resDelete = bo.Delete(resList.Result.First().Id); resList = bo.ListNonDeletedAsync().Result; Assert.IsTrue(resDelete.Success && resList.Success && resList.Result.Count == total - 1); }
public void TestDeleteCourse() { ContextSeeders.Seed(); var bo = new CourseBusinessObject(); 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); }