Auto Mapping Entities to Targets

Posts   
 
    
vivacee
User
Posts: 8
Joined: 23-Jun-2011
# Posted on: 23-Jun-2011 20:50:48   

In v3.1, is there a command line tool that will allow me to auto map all of my defined entities into SQL Server 2008 targets? I don't want to have to open the designer to do this.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 23-Jun-2011 21:52:10   

Sorry -no. We have the command line refresher ported to 3.1 but it will only refresh already mapped entities.

How many entities do you have ?

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Jun-2011 10:02:57   

Just use the designer, it's a 10 seconds action, tops. Right-click 'SQL Server (SQLClient)' in catalog explorer' -> reverse engineer tables to entity definitions -> check all -> go.

Frans Bouma | Lead developer LLBLGen Pro
vivacee
User
Posts: 8
Joined: 23-Jun-2011
# Posted on: 24-Jun-2011 15:42:09   

I am trying to write a tool that can use .net reflection to read a set of .net classes that are part of a data model and produce a properly formatted llblgen project file that includes entity definitions and fields. The requirement is to not have to open the designer at all during the whole process. The only step that is missing is the auto mapping, which is not available via a command line.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Jun-2011 16:48:39   

And what are you going to do with the file, if I may ask? simple_smile At one point you have to load it into the designer to do things... Or do you use the command line code generator? The problem is that if something is not valid, or the automapper can't create a field for example because a type needs a type converter or other, it is a problem you can't solve in code, you need the designer for that.

Btw, v3.1 has an import system. You could create a simple importer (see the sourcecode in the sdk) to import the entities from the assembly and go from there.

Frans Bouma | Lead developer LLBLGen Pro
vivacee
User
Posts: 8
Joined: 23-Jun-2011
# Posted on: 24-Jun-2011 17:17:09   

Even if I write an importer, is still sounds like the importing must be initiated by the llblgen designer. Is that correct?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 24-Jun-2011 21:28:05   

vivacee wrote:

Even if I write an importer, is still sounds like the importing must be initiated by the llblgen designer. Is that correct?

yes.

The upside is that you get the validation and correction facilities inside the designer as well. Don't really see the advantage of doing it outside the designer... sooner or later you'll have to open the file in the designer, export DDL SQL etc. anyway.

Frans Bouma | Lead developer LLBLGen Pro