Пример #1
0
        public ActionResult <SearchStringActionDto> CreateSearchStringAction(CreateSearchStringAction newAction)
        {
            var action = _mapper.Map <SearchStringAction>(newAction);

            _repository.AddSearchStringAction(action);
            return(CreatedAtAction(nameof(GetSearchStringActionById), new { id = action.Id },
                                   _mapper.Map <SearchStringActionDto>(action)));
        }
        private CreateSearchStringAction CreateSearchStringAction(SearchActionType type, string searchString, string username)
        {
            var action = new CreateSearchStringAction
            {
                Username     = username,
                Created      = DateTime.UtcNow,
                SearchType   = type,
                SearchString = searchString
            };

            return(action);
        }