public ActionResult <object> Get(long boardId, string id = null) { try { if (id == null) { return(_service.GetColumns(boardId).ToList()); } return((Column)_service.GetColumn(boardId, id)); } catch (NotFoundException ex) { return(NotFound(ex)); } }
public IBoard GetBoard(long id, bool includeColumns = false, bool includeCards = false) { if (includeCards && !includeColumns) { throw new InvalidIncludeException(); } var board = _boardService.GetBoard(id).Clone(); if (includeColumns) { var columns = _columnService.GetColumns(id).Select(x => x.Clone()).ToList(); if (includeCards) { foreach (var column in columns) { column.Cards = _cardService.GetCards(id, column.Id).Select(x => (Card)x); } } board.Columns = columns; } return(board); }
public ActionResult Save(int?id) { ViewTemplateColumnModel viewTemplateColumn = null; ViewBag.ColumnNamesList = new SelectList(columnService.GetColumns().OrderBy(c => c.Name), "Name", "Name"); try { if (id == 0) { return(PartialView()); } var viewTemplateColumnDTO = viewTemplateColumnService.GetViewTemplateColumn(id); viewTemplateColumn = Mapper.Map <ViewTemplateColumnDTO, ViewTemplateColumnModel>(viewTemplateColumnDTO); } catch (ValidationException ex) { logger.Error(ex.ToString()); } return(PartialView(viewTemplateColumn)); }
public async Task <IActionResult> GetColumns() { var columns = await _columnsService.GetColumns(); return(Ok(columns)); }