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 Жыл бұрын
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.
@imadabab7 ай бұрын
Amazing. Thanks a lot. Please keep it up.
@justpickandlearn7 ай бұрын
Thank you sir!
@kiran-bobade9 ай бұрын
you are too good n explaining things
@justpickandlearn9 ай бұрын
Thanks for the encouragement !
@asmarafiq14538 ай бұрын
Best course ❤
@justpickandlearn8 ай бұрын
Thank you
@muhammednashaf8136 Жыл бұрын
Thank you for awesome tutorials. If you can please do tutorial for .Net core web API in future.
@justpickandlearn Жыл бұрын
Yes sure..
@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 Жыл бұрын
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 Жыл бұрын
@@justpickandlearn Thanks Sahana..
@girishraghoji9686 Жыл бұрын
Please Upload all the videos of entity core.
@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.