Indeed Radzen needs a relationship at DB level in order to create the corresponding EF Core code. This in turn allows for using $expand (which translates to a SQL JOIN).
Probably you can use this approach to create a new property (CustomerName) and set it from code. Something like this:
First create a new partial class to extend the Order class:
public partial class Order
{
public string CustomerName {get; set;}
}
Then ignore the customer property by extending the EF context that Radzen has generated for your DB.
public partial class <YOUR DB>Context
{
partial void OnModelBuilding(ModelBuilder builder)
{
builder.Entity<Order>().Ignore(e => e.CustomerName);
}
}
Then extend the OrdersController by creating a new partial class and defining the OnOrdersRead method. In that method read the CustomerName property based on the current order CustomerID.
public partial class OrdersController
{
partial void OnOrdersRead(ref IQueryable<Order> items)
{
items = items.Select(order => new Order{
OrderID = order.OrderID,
CustomerName = yourdbcontext.Customers.First(c => c.CustomerID == order.CustomerID).Name
});
}
}
Then you can add a new column to your Orders data-grid. Set the column Property to CustomerName. You will have to type it as it won't appear in the property dropdown.