public ShowBoardViewModel(int id, string name, List <ListViewModel> lists, CreateListDto createListDto) { Id = id; Name = name; Lists = lists; CreateListDto = createListDto; }
public async Task <ActionResult> Create(CreateListDto createListDto) { var boardId = await _listsService.CreateNewList(createListDto); if (boardId == null) { return(HttpNotFound()); } return(RedirectToAction("Show", "Boards", new { selectedBoard = boardId })); }
public void AddList(CreateListDto dto) { var list = new List { Name = dto.Name, BoardId = dto.BoardId }; using (var db = new PGSBoardContext()) { db.Lists.Add(list); db.SaveChanges(); } }
public async Task <long?> CreateNewList(CreateListDto createListDto) { var count = await _listsRepository.GetCountListsInBoard(createListDto.BoardId); var list = new List() { Name = createListDto.Name, BoardId = createListDto.BoardId, Position = count }; _listsRepository.Insert(list); await _listsRepository.SaveChangesOnContext(); return(createListDto.BoardId); }
public IActionResult CreateList([FromBody] CreateListDto createListDto) { var list = _mapper.Map <List>(createListDto); try { var createdList = _listService.Create(list); var res = new ObjectResult(new { listId = createdList.Id }); res.StatusCode = StatusCodes.Status201Created; return(res); } catch (Exception ex) { return(BadRequest(new { message = ex.Message })); } }
//Method for creating new list public void CreateList(CreateListDto dto) { this.boardsRepository.AddList(dto); }
public ActionResult CreateList(CreateListDto dto) { _boardsService.CreateList(dto); return(RedirectToAction("Show", new { SelectedBoardId = dto.BoardId })); }
public ShowBoardViewModel() { CreateListDto = new CreateListDto(); Lists = new List <ListViewModel>(); }
public Task <RequestResult <ListModel> > CreateListAsync(CreateListDto dto) { string requestId = RequestIdProvider.GetRequestId(); return(_webApiClient.ExecuteRequestAsync(webApi => webApi.CreateList(requestId, dto))); }