title: How to get data from two tables and save it in DTO in Net Core Entity Framework?
body: <p>I just explain this in example, say I have two tables, field and modulefield</p>
  
  <pre><code>field
  id     name          ismodule
  1      Firstname     1
  2      Lastname      0
  
  modulefield
  id     moduleid      fieldid
  1      22            1
  </code></pre>
  
  <p>That is a simple representation of my database. Now in EF, how can I get a row with these columns</p>
  
  <pre><code>modulefield.moduleid     field.id     field.name
  22                       1            Firstname
  </code></pre>
  
  <p>Basically, I just want to get the modulefield.moduleid if the field.ismodule is true.</p>
  
  <p>The equivalent sql script I think for this is</p>
  
  <pre><code>SELECT b.submoduleid, a.* FROM field a, modulefield b;
  </code></pre>
  
  <p>My current code is this(snippet)</p>
  
  <pre><code>   var result = new List&lt;FieldDTO&gt;();
     var fields = await _repo.GetAsync&lt;Field&gt;();
     result = _mapper.Map&lt;List&lt;FieldDTO&gt;&gt;(fields);
  </code></pre>