Custom Field To Override

Posts   
 
    
Gianc1412
User
Posts: 40
Joined: 30-Oct-2007
# Posted on: 02-Jul-2009 18:34:05   

Lets say I have a database table with the following fields: 'ID','FirstName,'LastName','Phone' .

I map the table and create the entity in the LLBLGEN designer called ClassRosterEntity

Is it possiable to add a custom field, for example, 'Name', in the designer so I could override in a code.

An example code snippet would be:


    [Serializable]
    public class ClassRosterObject : ClassRosterEntity
    {
        public ClassRosterObject() : base() { }

        public ClassRosterObject(int id) : base(id) { }

        private ClassRosterObject(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { }

        public override string Name
        {
            get
            {
                return string.Format("{0}, {1}", base.LastName, base.FirstName);
            }
        }
    }

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 02-Jul-2009 21:44:19   

Why do you need to do this ? - could you just add a property to a partial class for the entity which returns the information that you need ?