示例#1
0
        public void CreateEvent(TfpEventViewModel model)
        {
            var ev = autoMapper.Map <TfpEvent>(model);

            unitOfWork.TfpEventRepository.Add(ev);

            unitOfWork.Save();
        }
示例#2
0
        public IActionResult Post([FromBody] TfpEventViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            tfpEventInterface.CreateEvent(model);

            return(Ok());
        }