Custom named projects?

Posts   
 
    
ianvink
User
Posts: 393
Joined: 15-Dec-2006
# Posted on: 05-Feb-2013 20:47:37   

Using EF 4

The root namespace of our project is: Company.Somename

so, the model and persistence project are named Company.Somename.Model.csproj and Company.Somename.Persistence.csproj

I have been asked to have the projects named:

Model.csproj and Persistence.csproj

Is there a way to have the c# code generate with the namespace, but have the project files named something different?

(I don't have control over the naming requirements)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Feb-2013 06:30:45   

Hi Ian,

Sure, you can. I assume you are using v3.5. Do this:

  • 1. Hit F7 (Generate code)
  • 2. Click the 'Advance...' button and go to 'Task queue to execute' tab.
  • 3. Cilck 'Save As...' button so you create a new preset and don't modify the shipped one. Select a new name like 'SD.EntityFramework.v4 (DBContext API) Custom' and choose a folder location and a name like 'c:\llblgen\mycustompresets\EFv4DBContextApiCustom.preset'.
  • 4. Now click the 'Generate VS.Net project file' task under the first task group ('Generate Entity Framework...Domain model...'). Then go to 'Taks Performer Parameters' sub-tab, go to 'filenameFormat' parameter and change from: [projectName].Model.[extension]proj to: Model.[extension]proj
  • 5. Do the same (4) for the 'Generate VS.NET project file' task on the other task group ('Generate Entity Framework Database ...').
  • 6. Click 'Save' button to save the changes on your custom preset.

That's it, you can generate the code now. As you probably saved your preset in a custom folder, you have to tell LLBLGen where to find it for the next time. For that do this:

  • 1. Go to Project -> Settings.
  • 2. Go to General category and at 'Additional task folder' setting select your custom folder where you saved your preset.
  • 3. Click 'OK'. Then go to Tools->'Refresh Code generation metadata' so the settings are refreshed.

It seems a lot of work but it's really easy, I just wanted to describe it in detail. Once you do that, you don't have to worry in the future, your custom preset to use is saved so you just have to hit F7.

David Elizondo | LLBLGen Support Team