title: Automapper for inner join LINQ
body: <p>Currently, I have successfully use Automapper to map my hall entity to Dto as below:</p>
  
  <pre><code>    [HttpGet]
      public async Task&lt;ActionResult&lt;IEnumerable&lt;HallDto&gt;&gt;&gt; GetHallDto()
      {
          return await _context.Halls
              .ProjectTo&lt;HallDto&gt;(_mapper.ConfigurationProvider)
              .ToListAsync();
      }
  </code></pre>
  
  <p>But for another web api method below, how do I use Automapper when my I have inner join LINQ? At the moment, this is how I manually map them.</p>
  
  <pre><code>    [HttpGet]
      public async Task&lt;ActionResult&lt;IEnumerable&lt;MovieHallDto&gt;&gt;&gt; GetMovieHallDto()
      {
          var movieHallListDto = await (from mh in _context.MovieHalls
                               join m in _context.Movies on mh.MovieId equals m.Id
                               join h in _context.Halls on mh.HallId equals h.Id
                               select new MovieHallDto
                               {
                                   Id = mh.Id,
                                   MovieTitle = m.MovieTitle,
                                   HallNo = h.HallNo,
                                   MovieDateTime = mh.MovieDateTime
                               }).ToListAsync();
  
          return movieHallListDto;
      }
  </code></pre>
  
  <p>Here is my AutoMapperProfile</p>
  
  <pre><code>public class AutoMapperProfile : Profile
  {
      public AutoMapperProfile()
      {
          CreateMap&lt;Movie, MovieDto&gt;();
          CreateMap&lt;Hall, HallDto&gt;();
          CreateMap&lt;MovieHall, MovieHallDto&gt;();
      }
  }
  </code></pre>