Extend generated entities to add custom attriubtes to properties

Posts   
 
    
AidanC
User
Posts: 1
Joined: 01-Dec-2008
# Posted on: 01-Dec-2008 05:18:05   

Hi

I want to use LLBLGENPRO in conjunctionwith Microsofts Enterprise Library 4.1 Validation framework. The feature I want to use from the validation framework is the ability to specify validation rules as attributes of public properties on the generated business entities.

**public class MyLLBLGENProGeneratedBusinessEntity {

[StringLengthValidator(1, 50, Ruleset="RuleSetA", MessageTemplate="First Name must be between 1 and 50 characters")] public virtual System.String Name { get { return (System.String)GetValue((int)MyLLBLGENProGeneratedBusinessEntityFieldIndex.Name, true); } set { SetValue((int)MyLLBLGENProGeneratedBusinessEntityFieldIndex.Name, value); } }**

How can I add custom attributes to properties of my generated business entities so that they will remain there even after re-generation?

Thanks

Aidan

wtijsma
User
Posts: 252
Joined: 18-Apr-2006
# Posted on: 02-Dec-2008 14:30:08   

Hi Aidan,

I remember this has been discussed before, see this thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11384

Best Regards,

Wiebe