Part-11: One-to-Many Relationship in entity framework core | Entity framework core 7.0 tutorial

  Рет қаралды 6,290

Just Pick and Learn

Just Pick and Learn

Күн бұрын

Пікірлер: 15
@nitindevgirikar322
@nitindevgirikar322 Жыл бұрын
and one more think in one-to-many relationship with manager without write foreign key, just write "public Manager Manager { get; set;}" (Navigation property to represent the Manger) this specific line will represent auto foreign key in SQL server table.. Am i right??? So, why we introduce Foreign Key "public int ManagerId {get; set;}" here in Employee entity. I Am confused about that.. Because i read Entity Framework documentation there are directly navigation property set without foreign key.. so, which one is the best practice??
@justpickandlearn
@justpickandlearn Жыл бұрын
Even this approach is correct, Entity Framework Core will automatically create a foreign key column in the Employee table named ManagerId. It uses conventions to infer the relationship. I chose to explicitly specify the foreign to make the things more clear. In my opinion both are okay, it all depends on what coding style you have chosen, and what is convenient for you.
@imadabab
@imadabab 7 ай бұрын
Amazing. Thanks a lot. Please keep it up.
@justpickandlearn
@justpickandlearn 7 ай бұрын
Thank you sir!
@kiran-bobade
@kiran-bobade 9 ай бұрын
you are too good n explaining things
@justpickandlearn
@justpickandlearn 9 ай бұрын
Thanks for the encouragement !
@asmarafiq1453
@asmarafiq1453 8 ай бұрын
Best course ❤
@justpickandlearn
@justpickandlearn 8 ай бұрын
Thank you
@muhammednashaf8136
@muhammednashaf8136 Жыл бұрын
Thank you for awesome tutorials. If you can please do tutorial for .Net core web API in future.
@justpickandlearn
@justpickandlearn Жыл бұрын
Yes sure..
@nitindevgirikar322
@nitindevgirikar322 Жыл бұрын
Sahana i have one doubt in one-to-many relationship with manager when we set foreign key as a "ManagerId", here this column name is same as a "Manager" entity or we assign any other name like "MId", "ManId"..etc... please clear my doubt
@justpickandlearn
@justpickandlearn Жыл бұрын
Employee table will have a column by name ManagerId. This column will represent the foreign key relationship between the Employee and Manager entities. If you want to change the column name you can use [ForeignKey("ManagerForeignKey")] data annotation attribute.
@nitindevgirikar322
@nitindevgirikar322 Жыл бұрын
@@justpickandlearn Thanks Sahana..
@girishraghoji9686
@girishraghoji9686 Жыл бұрын
Please Upload all the videos of entity core.
@justpickandlearn
@justpickandlearn Жыл бұрын
Yes sure I will upload all the videos. As I am in the process of recording videos I am posting one by one. If you expecting any specific topic you can let me know.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Getting Started with Entity Framework Core in .NET
26:51
Nick Chapsas
Рет қаралды 33 М.
Testing Entity Framework Core Correctly in .NET
8:03
Nick Chapsas
Рет қаралды 32 М.
CLR, CTS, CLS working together in .net framework
6:18
vivek kumar
Рет қаралды 167
[Arabic] Entity Framework Core - 25 One To Many Relationship - Part 1
13:29
DevCreed | محمد الهلالي
Рет қаралды 14 М.
EF Core 8 Finally Fixes Value Objects
11:25
Milan Jovanović
Рет қаралды 27 М.
ASP.NET Core Web API .NET 6 2022 - 3. One-To-Many Relationships
11:47
Razor Pages vs MVC vs Blazor
6:30
CodeGanesh
Рет қаралды 5 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН