예제 #1
0
        public IActionResult MakePayment([FromBody] CreateHistoryModel model)
        {
            var historyMapped = _mapper.Map <History>(model);

            var created = _historyService.Create(historyMapped);

            if (!created)
            {
                return(StatusCode(500, "Not created"));
            }

            return(Created("payment", historyMapped));
        }
        public async Task <IActionResult> CreateSearch([FromBody] CreateHistoryModel model)
        {
            if (model == null)
            {
                return(BadRequest());
            }

            var search = new Search
            {
                Text   = model.Text,
                Date   = model.Date,
                UserID = model.UserID
            };

            var result = await _SearchHistoryRepository.Add(search);

            return(Ok(result));
        }