This is a migrated thread and some comments may be shown as answers.

Incorrect generated names

1 Answer 30 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrii
Top achievements
Rank 1
Andrii asked on 23 May 2013, 09:46 AM
Hi! We have troubles with names of generated properties, for example:
Person have 2 addresses: home and current. Table Person have two columns that have relations with Address table 
Hi! We have troubles with generated names of properties, for example:
Person have 2 addresses: home and current. Table Person have two columns that have relations with Address table 
But generated by OA properties in Person have names like:
private Address _address;
        public virtual Address Address
        {
            get
            {
                return this._address;
            }
            set
            {
                this._address = value;
            }
        }
 
private Address _address1;
        public virtual Address Address1
        { ...}
In table columns with foreign keys have names like HomeAddressId, CurrentAddressId
How to generate names for these properties  like HomeAddress and CurrentAddress?

1 Answer, 1 is accepted

Sort by
0
Yordan
Telerik team
answered on 24 May 2013, 12:58 PM
Hello Andriy,

To rename the generated navigational properties just open the .rlinq file in the designer. Then select the navigational properties of type Person and hit F4 so the properties window is opened. In the properties window change the name to the desired value.The code that is generated after that will be similar to the following:
private Address _address;
public virtual Address CurrentAddress
{
    get
    {
        return this._address;
    }
    set
    {
        this._address = value;
    }
}
 
private Address _address1;
public virtual Address HomeAddress
{
    get
    {
        return this._address1;
    }
    set
    {
        this._address1 = value;
    }
}

More about navigational properties can be found in this article.

Find the attached picture as a guide where the change have to be made. If you have any more questions about the subject please get back to us.
 
Regards,
Yordan
Telerik
OpenAccess Samples Kit boasts 50+ sample applications providing diverse real-life business solutions. Click to read more and see OpenAccess ORM in action.
Tags
Data Access Free Edition
Asked by
Andrii
Top achievements
Rank 1
Answers by
Yordan
Telerik team
Share this question
or