title: How to create a query between two tables in an ASP.NET MVC web application?
body: <p>I'm having trouble creating a query between my tables 'utente' and 'indirizzo_residenza' that will do:</p>
  
  <pre><code>SELECT * 
  FROM utente, indirizzo_residenza 
  WHERE utente.idutente = indirizzo_residenza.idutente;
  </code></pre>
  
  <p>Right now I can only query one table or the other and return it as <code>OkObjectResult</code> object</p>
  
  <pre><code>namespace WebApplication1.Controllers
  {
      [Route("api/[controller]")]
      [ApiController]
      public class UtentesController : ControllerBase
      {
          private readonly resdataContext _context;
  
          public UtentesController(resdataContext context)
          {
              _context = context;
          }
  
          // GET: api/Utentes/GetUtente
          [HttpGet("[action]")]
          public async Task&lt;IActionResult&gt; GetUtente()
          {
              if (!ModelState.IsValid)
              {
                  return BadRequest(ModelState);
              }
  
              var address = _context.IndirizzoResidenza.FromSql("Select * from indirizzo_residenza");
              var users = _context.Utente.FromSql("SELECT * FROM utente");
  
              /* string q = "SELECT * from utente,indirizzo_residenza where utente.idutente=indirizzo_residenza=idutente;";
              */
  
              if (utente == null)
              {
                  return NotFound();
              }
  
              return Ok(users);
          }
      }
  }
  </code></pre>
  
  <p>How can I manage to merge those two queries?</p>
  
  <p>Thanks</p>