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);
     }
 }
示例#2
0
        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));
        }
示例#3
0
 public void Cadastrar(Registro registro)
 {
     _registroRepository.Add(registro);
     _registroRepository.SaveChanges();
 }