'Using Navigation properties?

I'm trying to set a foreign key with

protected void AdresDetailsView_ItemInserting(object sender,     DetailsViewInsertEventArgs e)
{
    var Id = Convert.ToInt32(CustomerDropDownList.SelectedValue);
    e.Values["Customer_Id"] = Id;
}

This does not work because my entity (Adres) does not have a property Customer_Id.
Customer_Id is the column name in the database and I should use the Customer property which is the navigation property.
But I don't know how to.

I'm using EF 4.5



Solution 1:[1]

Are you using Code First? If so, I would recommend creating your own foreign key properties and using the Fluent API to establish your constraints and relationships.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Raymond Saltrelli