There is no property with the name "restriction_class_id" defined in the type specified by Role 'phones_extensions'

I created a new Entity Framework database from a database. This database contains several tables, the main table is telephones. The phones_extensions table contains columns that are FK for other tables - for example. class_id constraint is the FK associated with the phones_restictions_class table, where PK is the identifier.

The EF4 model automatically creates associations for tables. Fine. Now, when I run my application, I see not only the numerical class_class_id delimiter, but also see the text content pulled by the association (for example, phones_restriction_class.name).

But what if I don't want to keep all these extra columns? I right-click and remove the restriction_class_id parameter, but now I get the error mentioned in the subject of this question.

Is there a way to remove the columns so that I don’t have to bother with them in my application, but still display the associations correctly?

+3
source share
3 answers

When you create your model, uncheck the "Include foreign key columns in the model on the" Select your database objects "page of the wizard.

+6
source

, , . , , . , .

+2

( ) :

1- 111 .

2- , .

3- "Del" .

4-

, , - ;)

+1

Source: https://habr.com/ru/post/1749231/


All Articles