public RemoteValidationResult ValidateBoardName(Board board) { var boardExists = Board.Exists(Expression.Eq("Name", board.Name)); if (boardExists) return RemoteValidationResult.Failure(string.Format("The board named {0} already exists. Please try a different name.", board.Name)); return RemoteValidationResult.Success; }
public JsonResult Add(Board board) { if (this.ModelState.IsValid) { board.SaveAndFlush(); return Json(Board.Find(board.Id)); } return null; }