public void CreateEvent(TfpEventViewModel model) { var ev = autoMapper.Map <TfpEvent>(model); unitOfWork.TfpEventRepository.Add(ev); unitOfWork.Save(); }
public IActionResult Post([FromBody] TfpEventViewModel model) { if (!ModelState.IsValid) { return(BadRequest()); } tfpEventInterface.CreateEvent(model); return(Ok()); }