One to many in UI

I’m missing some pieces to use locode as a backoffice generator.
That is the handling of one to many connections from the “one” to the “many”, and making it easy to use for the staff.

I will use the Northwind locode example to illustrate.

The staff receives an email to check on an order from “Chop-suey Chinese” and goes to the Customer and finds the user by search.

They now need to list all orders. If there was an “Orders” column that would link to the “Order” page, filering on the correct CustomerId that would save a lot of typing. filering

Now they need to check the details of the relevant order.

.

If there was a “Details” column, linking to the “Order Detail” with the correct filtering, that would again save a lot of time.

Looking at the details, the staff realises that one more production must be added, and they add that. While the filtering affects the listing, it does not influence the Order Id.

So the staff must first show all orders, then filter by the wanted order id. And by the way, the previous filtering is not available.


This is required to get the correct relationship for this new order detail:

If it was possible to have some kind of Context/Navigation/Nesting that remembered the current association followed, that could visible on the top, similar to a Filter, and possibly with some more enhanced formatting. This would be a stack of the relationships followed, allowing a click to navigate to a previous one, or an X to remove (the last one).

In this example it would be:

  • “Customer” page - No Nesting. Clicking “Orders”
  • “Order” page, Nesting: CustomerId = 'CHOPS' or even better using the same rules as any foreign key to CustomerId.
  • “Order Detail” page, Nesting: “CHOPS > OrderId = 10764”

This nesting would both set the filtering on navigation using an appropriate column, and it would pre-select the corresponding field when creating a new record.

The functionality described above would be a life saver for us, making it staff friendly to operate, with a minimum of clicking.

I assume that locode is still in development, so I hope this feedback can help suggests a minimal enhancement, that is very time saving.

I think you’re asking about defining POCO References, it’s not really possible to add them to Database-first Locode Apps like Northwind (since you can’t code-gen a new List<Order> property for the non-existent Order type), but if you export the database models into C# types you can add the POCO Reference on Customers to the Orders table, e.g:

public class Customer
{
    //...
    [Reference]
    public List<Order> Orders { get; set; }
}

This is used a lot in https://talent.locode.dev like its Job Applications where its POCO References :

are rendered like:

image

I see, then I will need to generate the Models for the database and annotate them.
That function does it ok, but is lacking the information about the filtering (i.e. the Navigation element I mentioned), and it is lacking the pre-filling of the relevant field, when creating a nested element.

Great with relation listing with Reference:

I would be very nice with a visual indicator that there is filtering due to navigation:

When creating a new record, and there is filtering due to navigation, a pre fill would be a time saver:

This should now be implemented in the latest v6.1.1 now available on MyGet.

Note: these filters aren’t normally preserved across navigations, but they should be for creating a new record just after navigating.