Duration 42:4

ASP .NET Core MVC CRUD Operations with Foreign key using CodeFirst Approach

28 346 watched
0
419
Published 12 Jan 2022

From this tutorial you will learn to use the Foreign Key Attribute in Entity Framework Core to configure the Foreign Key Property. We use the Foreign Key to define the relationship between tables in the database. For Example, In Our Inventory Manager Project, which we are doing for couple of months now. Every Product has a Measurement of Unit, like PCS, Liters, Kgs etc. Our Product table is in relationship with the unit table. I mean, The name and description of the unit is stored in the unit Table and the unitId is stored in the Product table. We express this relationship by creating a UnitID Column in the Product table and marking it as Foreign Key. In this example, the Unit is the Principal entity & Product is a Dependent entity. From this tutorial You will also learn how to use multiple repositories from a Single Controller. In our Project Unit details can be only accessed by the Unit Repository. Whereas Our Product controller needs to read unit details from the units table. So how to solve this issue. watch it I bet you like it. and also you will learn in detail about the importance of Migration Commands and Pagination feature to the CRUD. It also explains the Sorting and Searching feature of the CRUD clearly. Then we will see the benefit of using the smallmoney datatype over float. and we will learn what is one-to-one relation and one-to-many relation. after that I Will show you how to create the Foreign key constraint between Multiple Tables. Finally I am very happy to share the sourcecode url of this application inside this video. and Much More.... So please watch and put your comments. Sorting Module link /watch/AXmlansO5Z-Ol previous Part Link. /watch/00CJPZifezqfJ Playlist Link /watch/FLOau_u_16jeS_gJYT83aHqJ9EB2MevKLP=tsil&YCAogqoZq-OZa Thanks Aniz

Category

Show more

Comments - 59