public async Task <CardsListDTO> CreateCardsListAsync(CardsListDTO cardsListDTO) { if (cardsListDTO.Type != "PlanCard" && cardsListDTO.Type != "HabitCard") { throw new Exception("Card type is not exist!"); } var newCardsList = new CardsList { BoardId = cardsListDTO.BoardId, Type = cardsListDTO.Type }; db.CardsLists.Add(newCardsList); await db.SaveChangesAsync(); return(new CardsListDTO { Id = newCardsList.Id, BoardId = newCardsList.BoardId, Type = newCardsList.Type }); }
public async Task <CardsListDTO> CreateCardsListAsync(CardsListDTO cardsListDTO) { return(await db.CardsLists.CreateCardsListAsync(cardsListDTO)); }
public async Task <CardsListDTO> CreateCardsListAsync([FromBody] CardsListDTO cardsListDTO) { return(await _cardsListService.CreateCardsListAsync(cardsListDTO)); }