Print Page | Close Window

Methods for code generation classes

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3533
Printed Date: 05-Sep-2025 at 4:23pm


Topic: Methods for code generation classes
Posted By: jhoward
Subject: Methods for code generation classes
Date Posted: 11-Jul-2012 at 9:15am
I'm writing a custom code generation template and I need to know the the members of the IdeaBlade.EntityModel.Edm.Metadata.EntityOrComplexTypeWrapper class. Where can I find documentation or something that will reveal them? I'm tired of guessing. And not doing well.
 
My immediate objective is to find method or property that will yield the database name of an entity, that is, the table name.
 



Replies:
Posted By: DenisK
Date Posted: 11-Jul-2012 at 9:40am
Hi jhoward,

Try the following,

var entityType = entityOrComplexType as EntityTypeWrapper;
var dbTableName = entityType.DbTableName;

Not sure if you've already known this but we ship our code generation templates source code (BaseDomainModelTemplate, DomainModelTemplate and DomainModelTemplateCodeFirst). They should be located in your DevForce2010 installation folder.


Posted By: jhoward
Date Posted: 12-Jul-2012 at 5:35am
Thanks. I finally figured out to add a reference to IdeaBlade.EntityModel.Edm.Metadata.dll to one of my projects. Then I could type in partial class names and let InteliSense lead me to the names and metadata. Which is what we all do all the time. Don't know why I didn't think of it this time.
 
My custom template is working great now! Thanks.



Print Page | Close Window