Пример #1
0
        public ActionResult <object> Create([FromBody] Migrant migrant)
        {
            Helper helper = new Helper();

            try
            {
                AdhaarIdFilter af = new AdhaarIdFilter();
                _migrantService.UpdateMigrantData(out migrant, migrant, af.IsValidAadhaarNumber(migrant.AadharNumber));
                return(_migrantService.Create(migrant));
            }
            catch (Exception)
            {
                return(helper.CreateResponse(404));
            }
        }
Пример #2
0
        public ActionResult <Migrant> Create([FromBody] Migrant migrant)
        {
            _migrantService.Create(migrant);

            return(CreatedAtRoute("GetMigrant", new { id = migrant.Id.ToString() }, migrant));
        }