entity template & field property implementation

Posts   
 
    
silky avatar
silky
User
Posts: 38
Joined: 03-Feb-2008
# Posted on: 13-May-2008 00:00:47   

in our version of llblgen a field named 'Price' is implemented like so:

        /// <summary> The Price property of the Entity Products<br/><br/>
        /// </summary>
        /// <remarks>Mapped on  table field: "tblProducts"."Price"<br/>
        /// Table field type characteristics (type, precision, scale, length): Decimal, 18, 3, 0<br/>
        /// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
        public virtual System.Decimal Price
        {
            get
            {
                object valueToReturn = base.GetCurrentFieldValue((int)ProductsFieldIndex.Price);
                if(valueToReturn == null)
                {
                    valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.Decimal));
                }
                return (System.Decimal)valueToReturn;
            }
            set { SetNewFieldValue((int)ProductsFieldIndex.Price, value); }
        }

the problem is that 'base.GetCurrentFieldValue' is called, as opposed to just plain-old 'GetCurrentFieldValue' (no base).

this screws me as I wanted to return a different value for the 'Price' field, and now my plan is to just write a new field. is there any reason it was done with a direct call to base? (i was planing to re-implement it in my partial class).

do i have any other options here, other then modifying the template in the designer?

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 13-May-2008 10:33:20   

Where did you want to place your custom code? Would you please post a code snippet of what you wished to do?