Похожие чаты

I m trying to connect two tables into a view.

So I created a view model that holds all the properties of both models.Created pk nd fk keys in tables.

Scaffolded utilizing ef core db first.. Index page is working fine.but while su bmitting data into db two tables separately, error show up tat 2nd table can't be traced since it dies not have pk key.But I hv assigned fk in 2nd and pk in primary table.

Then i commented a line in dbcontext class auto-generated fluent api code on
//model.hasKey(2nd table).

Now submitting data to two tables is working.i assigned 2nd table Id to the primary tile Id statically inside controller.
Is this right approach? why pk and fk relationships not works? Pls somebody  guide me

2 ответов

8 просмотров

im not understaging a bunch of things; i assume you are using code first approach how come the two tables had not a relationship before? are you mapping to a dto for the view? do you have both the fk and the inverse property in the relation?

equity-investor Автор вопроса
luca flan di vedure
im not understaging a bunch of things; i assume yo...

I m using database first approach i already build tables and pk and fk key in sql server then only I created project in vs and scaffolded tables in package manager console in the auto-generated code, second model class has Navigation property . But still error displays when create Action is posted

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта