Esempio n. 1
0
        public async Task <IActionResult> Post([FromBody] Transit value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            value.Code = await _sequenceRepository.GetCode("Transit");

            await _transitRepository.InsertAsync(value);

            return(Created($"transit/{value.TransitId}", value));
        }
        public async Task <IActionResult> Post([FromBody] Transit value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await _transitRepository.InsertAsync(value);

            value = _transitRepository.GetAll().Where(n => n.TransitId == value.TransitId).FirstOrDefault();

            return(Created($"transit/{value.TransitId}", value));
        }