Adding namespaces and interfaces to Typed Views

Posts   
 
    
Posts: 12
Joined: 05-Aug-2010
# Posted on: 11-Aug-2010 15:21:57   

How can I add additonal namespaces and interfaces to Typed Views? I could do it for Entities using the Project Propeties Option(Code Gen Meta Data Defaults). However, those tabs are disabled for Typed Views.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-Aug-2010 15:51:04   

Create a template to generate partial class files for the TypedViews, inwhich you can add additional namespaces and/or Interfaces.

Same concept was discussed here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=18339

Posts: 12
Joined: 05-Aug-2010
# Posted on: 11-Aug-2010 18:58:29   

Thanks. I took care of it in a template. Also, do you have samples for templates.We have some fields with a '-' in the field name. I would like to wrap the database fields in the mappings with a [].

Map(x=>x.MidRollInterval).Column("mid-roll_interval").Access.CamelCaseField(Prefix.Underscore);

so it would now appear as Map(x=>x.MidRollInterval).Column("[mid-roll_interval]").Access.CamelCaseField(Prefix.Underscore);

Posts: 12
Joined: 05-Aug-2010
# Posted on: 11-Aug-2010 21:21:26   

I have updated the template for Typed Views (and mappings) too. Is there a site where I can get some 'common' templates? Thanks!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Aug-2010 04:58:41   

DasDirector wrote:

I have updated the template for Typed Views (and mappings) too. Is there a site where I can get some 'common' templates? Thanks!

What do you mean by 'common tempaltes'?

David Elizondo | LLBLGen Support Team
Posts: 12
Joined: 05-Aug-2010
# Posted on: 12-Aug-2010 14:28:25   

I should have labeled samples (instead of commons). For instance samples for adding additional interfaces or namespaces to typed views depending on a certain condition. However, I beginning to find my way around.

I use the Grouping feature in the designer and noticed that a particular group of FluentHibernate Mappings has the following line generated - Table("[AN_OPT].[dbo].[opt_m_by_day]"); Mappings in other groups are as - Table("[dbo].[time_chunk_pattern]");

I would like all Mappings to define the table using the form - Table("[dbo].[time_chunk_pattern]"); to keep consistency when queries are generated. Any idea why does the designer append "[AN_OPT]" ?

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 12-Aug-2010 15:01:36   

This happens when you have multiple catalogs in the project, otherwise it won't emit the catalog name in the mappings. This is done because it can otherwise not distinguish between which catalog the 'dbo' schema is located in. Do you have multiple catalogs in the project?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 12
Joined: 05-Aug-2010
# Posted on: 12-Aug-2010 16:32:00   

Yes, we do have multiple catalogs and in fact now that I realize there are a handful of tables with same names. Thanks for the explanation.