public IHttpActionResult GetOneBoard(int id) { var board = _br.GetSingle(id); if (board == null) { return(NotFound()); } return(Ok(board)); }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //Board board = await db.Board.FindAsync(id); Board board = _br.GetSingle(id.Value); if (board == null) { return(HttpNotFound()); } return(View(VMConverters.ModelToViewModel(board))); }
public void TestAddInvalidBoardSameName() { var uniqueboard = _br.GetSingle(1); var board = new Board { Name = uniqueboard.Name, Discription = "teste repeated board" }; try { _br.Add(board); } catch (Exception ex) { Assert.IsTrue(ex is DbEntityValidationException); } }