ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.Entity Framework : data fetching from child table join parent table<p>Hi,</p> <p>Please refer below code.</p> <p><span style="text-decoration: underline;">C#</span></p> <pre class="brush: csharp">List&lt;Users&gt; users = new List&lt;Users&gt;(); users.Add(new Users { Id = 1, Type = &#34;admin&#34; }); users.Add(new Users { Id = 2, Type = &#34;customer&#34; }); List&lt;Transactions&gt; transactions = new List&lt;Transactions&gt;(); transactions.Add(new Transactions { Id = 1, UserId = 1, Amount = 200 }); transactions.Add(new Transactions { Id = 2, UserId = 2, Amount = 200 }); transactions.Add(new Transactions { Id = 3, UserId = 1, Amount = 200 }); List&lt;Transactions&gt; customerTransactions = (from transaction in transactions join user in users on transaction.UserId equals user.Id where user.Id == 1 select transaction).ToList&lt;Transactions&gt;();</pre> <p><span style="text-decoration: underline;">Transactions and Users Class</span></p> <pre class="brush: csharp">public class Transactions { public int Id { get; set; } public int UserId { get; set; } public int Amount { get; set; } } public class Users { public int Id { get; set; } public string Type { get; set; } }</pre> <p>I hope this will help you out.</p>http://www.aspforums.net/Threads/177296/Entity-Framework-data-fetching-from-child-table-join-parent-table/http://www.aspforums.net/Threads/177296/Entity-Framework-data-fetching-from-child-table-join-parent-table/Wed, 30 Mar 2016 04:50:48 GMT