Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> How to get a DBTableField
 

Pages: 1
LLBLGen Pro Runtime Framework
How to get a DBTableField
Page:1/1 

  Print all messages in this thread  
Poster Message
spud19
User



Location:

Joined on:
25-Apr-2016 11:53:22
Posted:
2 posts
# Posted on: 25-Apr-2016 11:59:06.  
Hi all,

I want to had something like this in my generated c#

Code:
[Column(TypeName = "nvarchar")]


I start in my lblgen like this :

Code:
Project currentProject = _executingGenerator.ProjectDefinition;
EntityDefinition entity = (EntityDefinition)_activeObject;
.....

foreach(IFieldElementCore field in entityFields)
{
****
//I need help here :

        var dbField = entity.FieldsMappedOntoRelatedFields;
        
        //DBTableField dbField = (DBTableField)entity.Fields[field.FieldIndex ].MappedField;
        //DBTableField dbField = field.TypeDefinition.DBTypeAsString.ToLowerInvariant();
        if (dbField.TypeDefinition.DBTypeAsString.ToLowerInvariant().Contains("varchar"))
        {
%>            //[Column(TypeName = "nvarchar")]
<%
        }        

****
}


I am block on that stupid problem since 2 days, so i request you help.

Tks in advance.

S.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37859 posts
# Posted on: 25-Apr-2016 16:44:01.  
http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7725

Also, as you seem to write a template (I'm guessing, you didnt' provide any context) please give more info about what you're after etc. as it's currently way too vague so we can't answer.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.