Dropdown values from different tables


I need to display data that is located in different tables but connected via foreign keys. Is there a way to do that?dd

If you have relationships you can use Include() method to populate related property similar to this demo:

<div style="margin-top:20px">Employee:</div>
<b>@(order.Employee?.FirstName + " " + order.Employee?.LastName)</b>
IEnumerable<Order> orders;

protected override void OnInitialized()
   orders = dbContext.Orders.Include("Customer").Include("Employee").ToList();
1 Like