public IActionResult saveTokenLogs([FromBody] TokenLogs tokenLog) { try { tokenLog.createdat = DateTime.Now; _csxContext.TokenLogs.Add(tokenLog); _csxContext.SaveChanges(); return(Ok(tokenLog)); } catch (System.Exception ex) { return(NotFound("Erro ao Salvar: " + ex.Message)); } }
public async Task <TokenLogs> Save(Tokens token, TokenLogs log) { try { log.createdat = DateTime.Now; _csxContext.TokenLogs.Add(log); //Update hits token.hits++; _csxContext.Tokens.Update(token); await _csxContext.SaveChangesAsync(); return(log); } catch (System.Exception ex) { throw ex; } }