Search code examples
asp.net-mvcvb.netllblgenpro

Using ViewModel with LLBLGen


I am using MVC 3 and LLBLGen. I am confused about approach on populating ViewModels that have data coming from multiple tables. How would i display the Foreign Key names instead of just ID? I don't have any virtual keywords like entity framework. Should i just resort to using SQL Views and then populate viewmodels through them? Just to elaborate more, let's say i want to display more than 100 results at a time and each result has multiple associated foreign keys then how would i display their relevant names rather just IDs?


Solution

  • IMHO, your choices are:

    1. Fields Mapped onto related fields. This has the advantage that you are still using normal Entities.
    2. TypedLists. This is like views, but the building blocks are entity relations and entity fields.
    3. Use TypedViews, that are actually DB Views.
    4. Use your own types, like DTO's or JSON projections. After all you are doing a kind of mapping between your business facade objects and the objects you use to show in your UI.