예제 #1
0
        public async Task <IActionResult> AddColumn(ColumnAddDto dto)
        {
            var columnToCreate = _mapper.Map <Column>(dto);

            _repo.Add <Column>(columnToCreate);

            if (await _repo.SaveAll())
            {
                return(Ok());
            }

            throw new Exception("Creating the column failed on save");
        }
예제 #2
0
        public async Task <IActionResult> AddGrid(int userId)
        {
            var gridToCreate = new Grid(userId);

            // var gridToCreate = _mapper.Map<Grid>(dto);

            _repo.Add <Grid>(gridToCreate);

            if (await _repo.SaveAll())
            {
                return(Ok(gridToCreate.Id));
            }

            throw new Exception("Creating the grid failed on save");
        }
예제 #3
0
        public async Task <IActionResult> Add(FeedRssAddDto dto)
        {
            // if (await _repo.ca ..UserExists(userForRegisterDto.Username))
            //     return BadRequest("Username already exists");

            var rssToCreate = _mapper.Map <FeedRss>(dto);

            _repo.Add <FeedRss>(rssToCreate);

            if (await _repo.SaveAll())
            {
                return(Ok());
            }

            throw new Exception("Creating the rss failed on save");
        }