Order of Derived Elements

Posts   
 
    
K Smit
User
Posts: 4
Joined: 20-Mar-2017
# Posted on: 22-Mar-2017 00:15:57   

Hi there

I'm trialling LLBLGen Pro and love it so far! (5.1.3 RTM)

Is it possible to set the order of the Derived Elements?

There is an Order column in the Entity Editor but not in the Derived Element Shape Editor. So when I add fields to the Derived Element Shape Editor it seems to be sorted alphabetically.

I'd like to manually order the Derived Element Fields, for example: Suburb, City, Province, Country because those DTOs are exposed in my API and it does not look good sorted alphabetically.

Regards Kobus

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Mar-2017 06:41:42   

Hi Kobus,

This is not built-in. There is one similar thread that resolves this using the "Order" property in the DataMember attribute. For this he created a plugin. See it here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=24097

David Elizondo | LLBLGen Support Team
K Smit
User
Posts: 4
Joined: 20-Mar-2017
# Posted on: 24-Mar-2017 03:10:42   

Thank you David.

I've created a new plugin using TopDog74 code but when I open any project in LLBLGenPro.exe I get this exception:

Exception information.
=============================================================
LLBLGen Pro version: v5.1. Build: 5.1.3

Exception details:
=====================
Message: Method not found: 'SD.LLBLGen.Pro.DBDriverCore.IProjectElementMapTargetElement SD.LLBLGen.Pro.ApplicationCore.Mapping.GroupableModelElementMapping.get_MappedTarget()'.
Source: SD.Frameworks.Validation.LLBLGenPro
Stack trace: 
   at SD.Frameworks.Validation.LLBLGenPro.FrameworkValidator.Validate(Project toValidate)
   at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.ValidateEntityModelFramework()
   at SD.LLBLGen.Pro.ApplicationCore.Parallelization.RealTimeWorkController.PerformEntityModelFrameworkValidation(String workId)
   at System.Threading.Tasks.Task.Execute()

Inner exception: <null>

When I debug the plugin it steps through the Describe method without any errors and then shows the above unhandled exception in the standalone designer.

Please advise.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Mar-2017 07:27:00   

Could you please attach your plugin code zipped, so we can take a look?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 25-Mar-2017 10:18:49   

The exception is very weird and we can't reproduce that (as the exception states it uses an outdated dll, which isn't the case, the method is there). Removing the plugin makes things work again?

Did you by any chance reference older dlls in the plugin dll? (e.g. from 5.0 or 4.2?)

Frans Bouma | Lead developer LLBLGen Pro
K Smit
User
Posts: 4
Joined: 20-Mar-2017
# Posted on: 27-Mar-2017 01:29:11   

Hi Frans and David

Please find attached the plugin's source and binaries, and screenshots.

As you can see it is an exact copy/paste of TopDog74's code and it only references the assemblies in C:\Program Files (x86)\Solutions Design\LLBLGen Pro v5.1.

I've never installed a version before v5.1.

And yes, if I remove the files from my custom plugin folder there is no error.

Preparing this post I have noticed that the exception does not occur when opening a blank new project, but it does occur opening my project's llblgenproj and also in other samples like "Auditing Example.llblgenproj" from https://github.com/SolutionsDesign/LLBLGenProExamples_5.x

Hope this helps.

Regards Kobus

Attachments
Filename File size Added on Approval
LLBLGen MissingMethodException.zip 942,088 27-Mar-2017 01:29.33 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Mar-2017 07:53:26   

Hi Kobus,

When I use your /Plugins folder in my LLBLGen preferences, yes I receive an error:

PluginStore::Error loading potential plug-in assembly file 'C:\Users\David\Downloads\LLBLGen_MissingMethodException\LLBLGen MissingMethodException\Plugins\InfometLLBLGenPlugin.dll': Could not load file or assembly 'filedisappointed //C:\Users\David\Downloads\LLBLGen_MissingMethodException\LLBLGen MissingMethodException\Plugins\InfometLLBLGenPlugin.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515). Plug-ins in this assembly will be unavailable

PluginStore::Error loading potential plug-in assembly file 'C:\Users\David\Downloads\LLBLGen_MissingMethodException\LLBLGen MissingMethodException\Plugins\SD.LLBLGen.Pro.DBDriverCore.dll': Could not load file or assembly 'filedisappointed //C:\Users\David\Downloads\LLBLGen_MissingMethodException\LLBLGen MissingMethodException\Plugins\SD.LLBLGen.Pro.DBDriverCore.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515). Plug-ins in this assembly will be unavailable

Then I open your, project, Clean and Build, replace the bin files, reopen LLBLGen Designer, and everything loaded successfully.

BTW, you don't need to include the LLBLGen assemblies (DBDrivercore, Algorithmia, etc) in the /Plugins folder. Just put there the plugins dlls.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 27-Mar-2017 10:08:34   

I think it's indeed caused by the 2 different versions of the dlls, one in the designer's installation folder, and one in the plugin's folder. When I place the plugin dll as-is in the designer's plugins folder it works OK.

No idea why 2 versions of the same dll cause this problem, might be fusion (.net's assembly loader) but in any case, like David said, just place the dll in the plugins forlder or set 'copy local' for the referenced assemblies to 'false' in the properties of the reference in the vs project.

Frans Bouma | Lead developer LLBLGen Pro
K Smit
User
Posts: 4
Joined: 20-Mar-2017
# Posted on: 28-Mar-2017 01:34:25   

Copy Local = False works for me.

Thanks for the assistance!