public ActionResult <SearchValueActionDto> CreateSearchValueAction(CreateSearchValueAction newAction) { var action = _mapper.Map <SearchValueAction>(newAction); _repository.AddSearchValueAction(action); return(CreatedAtAction(nameof(GetSearchValueActionById), new { id = action.Id }, _mapper.Map <SearchValueActionDto>(action))); }
private CreateSearchValueAction CreateSearchValueAction(SearchActionType type, double avg, string username) { var action = new CreateSearchValueAction { Username = username, Created = DateTime.UtcNow, SearchType = type, SearchValue = avg }; return(action); }