コード例 #1
0
        public IActionResult CreateSearch(SearchForCreationOrUpdateDto searchUpdateDto)
        {
            var searches = _mapper.Map <SearchHistory>(searchUpdateDto);

            _dataService.CreateSearch(searches);

            return(Created("", searches));
        }
コード例 #2
0
        public IActionResult UpdateSearch(int id, SearchForCreationOrUpdateDto searchUpdateDto)
        {
            var searches = _mapper.Map <SearchHistory>(searchUpdateDto);

            searches.UserId = id; //this fixes the id null value

            if (!_dataService.UpdateSearch(searches))
            {
                return(NotFound());
            }

            return(NoContent());
        }