public BaseServiceResponse <Registro> RegistrarPonto(Registro registro) { try { _repository.Add(registro); return(new BaseServiceResponse <Registro>()); } catch (Exception ex) { var response = new BaseServiceResponse <Registro>("Erro ao salvar registro."); return(response); } }
public async Task <IActionResult> PostRegistro([FromBody] Registro registro) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _context.Add(registro); await _context.SaveChanges(); return(CreatedAtAction("GetRegistro", new { id = registro.Id }, registro)); }
public void Cadastrar(Registro registro) { _registroRepository.Add(registro); _registroRepository.SaveChanges(); }