Macro for splitting field name

Posts   
 
    
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 25-Feb-2017 19:30:36   

I'm looking for a way to generate the Display Name attribute value in the model. Ideally it would add a space prior to all uppercase letters after the first one. Is there a macro that would allow me to do this type of thing?


        [Display(Name = "Order Date")]
        public DateTime? OrderDate { get; set; }

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Feb-2017 06:48:02   

You can defines attributes at Project Settings, you also could do that in element level. When you define an attribute you can specify some macros. These are the built-in macros.

What you want is not possible with a simple attribute definition. You have to write code that search on your entities and change the attribute value. See the Element Search for more information.

Based on that .net code to search and replace the attribute you could write a custom plugin to set the appropriate names for the attribute. For more information see Implementing a plugin in the SDK documentation.

David Elizondo | LLBLGen Support Team
jovball
User
Posts: 435
Joined: 23-Jan-2005
# Posted on: 27-Feb-2017 12:16:22   

I'd like to request this as a new feature. Should I open a new thread in that forum for this or can you move this thread there for me? I will add more specifics when it is in the right forum.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Feb-2017 16:59:09   

Hi Joel,

Please create a new thread on the "Feature Requests" forum ( http://www.llblgen.com/TinyForum/Threads.aspx?ForumID=35 ) and give us more details about your request. You can refer this thread there if you like.

Regards.

David Elizondo | LLBLGen Support Team