Ejemplo n.º 1
0
        // POST api/PersonDetail
        public void Post([FromBody] PersonDetail person)
        {
            if (!ModelState.IsValid)
            {
                throw new Exception("Validation failed");
            }

            try
            {
                _generalRepository.SavePerson(person.ToDataModel());
            }
            catch
            {
                throw new Exception("An error occurred");
            }
        }