Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Designer> Adding attributes to properties
 

Pages: 1
Designer
Adding attributes to properties
Page:1/1 

  Print all messages in this thread  
Poster Message
nbrake
User



Location:
Hamburg, Germany
Joined on:
18-May-2008 22:27:47
Posted:
30 posts
# Posted on: 19-Nov-2010 20:03:30.  
Dears at LLBLGen,

I am using version 3.0 Final, October 22nd, 2010. I am generating entity classes from a DB model.

I found out that it is possible to have attributes applied to all properties of a certain kind (NavigatorCollection, etc.) which means that these attributes are always re-applied after every generation. But is it possible, in the designer, to have an attribute applied to a certain property of an entity?

Thank you

Nasser


  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
7667 posts
# Posted on: 20-Nov-2010 04:57:56.  
Hi Nasser,

Sure you can. Just:

1. Go to entity editor of the involved entity.
2. Select the "Code gen info" sub tab (below).
3. Select the "Attributes" sub tab (above)
4. On the Attribute definition grid, add the desire attribute.

Also, if you added a object type Attribute at Project Properties->Code gen options (for example, Entity attribute), you can edit an entity and select that you don't want that entity inherits that attribute.

For more info read this.

Hope helpful Wink


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
nbrake
User



Location:
Hamburg, Germany
Joined on:
18-May-2008 22:27:47
Posted:
30 posts
# Posted on: 20-Nov-2010 13:03:53.  
Dear David!

Thank you for your reply!

The solution you describe would add an attribute to the class definition like

Code:

[SomeAttribute()]
public class SomeEntity
{
    int SomeProperty { get; set;}
}




I need to add an Attribute to a property, and have that attribute regenerated every time I generate code from the designer. Somethings like

Code:

public class SomeEntity
{
    [SomeAttribute(typeof(int), "SomeString")]
    int SomeProperty { get; set;}
}



Is it possible to define an Attribute per Property in the designer?

  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
34993 posts
# Posted on: 20-Nov-2010 14:33:13.  
Yes, just select the field or navigator in the combo box on the tab David mentioned. Regular Smiley In there you can select to keep the inherited attributes from the project settings and / or add new ones, just for that field.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
nbrake
User



Location:
Hamburg, Germany
Joined on:
18-May-2008 22:27:47
Posted:
30 posts
# Posted on: 21-Nov-2010 12:00:02.  
Thank you for the explanation!
  Top
Pages: 1  


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

Version: 2.1.12172008 Final.