First of all, the removal of these two factories is by far the biggest change we made in the history of llblgen. In v3 we removed them, as we kept them disabled for so long in v2. You move from v1 to v3.5 so you make a big step, similar to moving from an asp.net 1 to asp.net MVC 4 application.
You can keep the v1 factories in your project btw, they still should be there, but of course if you change entities you want them to be updated.
Please take the following steps. (I assume you're using adapter, you haven't specified this. For selfservicing, it's almost the same, you just have to alter a different preset).
- in the folder on disk where your llblgenproj file is located, create a folder: AdditionalTemplates
- Copy into this folder the predicatefactoryadapter.template and the sortclausefactoryadapter.template. They're in <v1 installation folder>\SharedTemplates\C#
- load your project in v3.5
- in Project settings, go to General , then set the Additional Templates folder to '.\AdditionalTemplates' (without the quotes)
- We're now going to add a template binding for the two templates. Go to: Window -> Show Windows Bindings Viewer.
- Click the 'New...' button at the right. A dialog pops up.
- Specify for Name: FactoryBindings
- Click the [...] button next to file name and save the file in the AdditionalTemplates folder you created in step 1. Give it a name: 'FactoryBindings'
- Click 'Save and close'. The dialog closes and your template bindings file is now created, and selected, but it's empty.
- Click 'Edit as XML'. This is faster, as I've prepared the contents for you below.
- Replace the contents of the file with the following:
<?xml version="1.0" encoding="utf-8"?>
<templateBindings name="FactoryBindings for migration" description="" precedenceLevel="10" xmlns="http://sd/llblgen/pro/templateBindingsDefinition.xsd">
<supportedPlatforms>
<platform name=".NET 2.0" />
<platform name=".NET 3.0" />
<platform name=".NET 3.5" />
<platform name=".NET 4.0" />
</supportedPlatforms>
<supportedFrameworks>
<framework name="LLBLGen Pro Runtime Framework" />
</supportedFrameworks>
<supportedDrivers />
<language name="C#">
<templateBinding templateID="SD_PredicateFactory" filename="predicatefactoryadapter.template" templateLanguage="TDL" />
<templateBinding templateID="SD_SortClauseFactory" filename="sortClauseFactoryAdapter.template" templateLanguage="TDL" />
</language>
</templateBindings>
- press cntrl-shift-S to save the template bindings file.
- click the green refresh button in the tool bar (or use Tools -> Refresh code generation meta data). The template bindings for 'FactoryBindings for migration' are now updated.
All set for the last step: adding the tasks.
- Press F7 and click 'Advanced' in the code generation dialog which pops up
- On tab 2, verify that your template bindings file is visible under 'found template bindings'
- On tab 3, select your preset. I presumed you're using adapter, so e.g. you select SD.Presets.Adapter.General2010. If you need/want to use another, no worries, the next step is fairly similar for all.
The following steps can also be done in XML, by editing the preset file or a copy of it. The steps below are using the UI in the designer.
- In the run queue, you'll see all tasks the code generator engine will execute. We'll add 2 more, one for the predicate factory and one for the sort clause factory. Scroll down to the SD.Tasks.Generic.EntityFactoryClassesGenerator task. Select it. Then click 'Add tasks' at the right
- In the Add task dialog, check the checkbox in front of 'SD.Tasks.Base.ConsumeTDLTemplate' (it's at the bottom), then click OK.
It is inserted before the SD.Tasks.Generic.EntityFactoryClassesGenerator task.
- Click the inserted task in the tree. In the 'selected task' information at the bottom, specify for display name 'Generate predicate factory'.
- Click the 'tasks performer parameters' tab.
For destinationFolder, specify: [dbgenericSubFolder]\FactoryClasses
For filenameFormat, specify: PredicateFactory.[extension]
For templateID, specify SD_PredicateFactory
Repeat the last 4 steps for the sortclause factory task as well. For the sortclause factory, you specify for task parameters:
For destinationFolder, specify: [dbgenericSubFolder]\FactoryClasses
For filenameFormat, specify: SortClauseFactory.[extension]
For templateID, specify SD_SortClauseFactory
-
Click 'Save as' to save the preset. If you have specified an additional tasks folder in the project settings, you can save it there, otherwise simply save it in the llblgen pro folder as suggested by the dialog.
-
Run the generator by clicking 'start generator' at the bottom.
This should give you the 2 factories generated in the vs.net project and added to the vs.net project.