title: Move connectionstring to appsettings.json
body: <p>I have the following DAO code:</p>
  
  <pre><code>using Dapper;
  using PerformanceComWebAPI.Modelos;
  using System.Collections.Generic;
  using System.Data.SqlClient;
  using System.Linq;
  
  namespace PerformanceComWebAPICompleto.DAO
  {
      public class ClienteDAO
      {
          //string da conexão com a base de dados
          private const string connectionString = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=TesteDapper;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
          /// &lt;summary&gt;
          /// Listar todos os cliente da base de dados
          /// &lt;/summary&gt;
          /// &lt;returns&gt;&lt;/returns&gt;
          public List&lt;Cliente&gt; Listar()
          {
              var sql = "select * from dbo.Cliente";
              List&lt;Cliente&gt; clientes = new List&lt;Cliente&gt;();
  
              using (var connection = new SqlConnection(connectionString))
              {
                  clientes = connection.Query&lt;Cliente&gt;(sql).ToList();
              }
  
              return clientes;
          }
  
          /// &lt;summary&gt;
          /// Metodo que recupera o cliente pelo id
          /// &lt;/summary&gt;
          /// &lt;param name="idCliente"&gt;id cliente que vai ser recuperado&lt;/param&gt;
          /// &lt;returns&gt;O cliente que correspondente do cliente ou null quando não tiver cliente com id&lt;/returns&gt;
          public Cliente RecuperarPorID(int idCliente)
          {
              var sql = "select * from dbo.Cliente where id = @id";
  
              Cliente cliente = new Cliente();
  
              using (var connection = new SqlConnection(connectionString))
              {
                  cliente = connection.QueryFirstOrDefault&lt;Cliente&gt;(sql, new { id = idCliente });
              }
  
              return cliente;
          }
      }
  }
  </code></pre>
  
  <p>I would like to know how I can move the connection string from this page and insert it in the appsettings.json file so I can reuse it with other pages.</p>