C
C#14mo ago
Lounder

✅ [EF Core] Why does my database entity have a one-directional FK Connection?

Business entity: BusinessPromotion BusinessPromotion { get; set; } BusinessPromotion entity: public Business Business { get; set; }
No description
5 Replies
Lounder
LounderOP14mo ago
Business:
No description
Lounder
LounderOP14mo ago
BusinessPromotions
No description
Lounder
LounderOP14mo ago
Please @ on reply
Stringy
Stringy14mo ago
It looks like a column hasn't been defined for the FK. Look at definition for VisitsEachMonths or BusinessImages, it looks like they use BusinessId too, or post a screenshot of one of them here. See in the Business screenshot you have OwnerId nvarchar(450) constraint FK_busi...... references AspNetUsers, there should be similar for BusinessPromotions. You should see that in VisitsEachMonths or BusinessImages definition.
Lounder
LounderOP14mo ago
Thank you for the reply. The problem has been resolved. ❤️

Did you find this page helpful?