Part 19 Table Per Hierarchy TPH inheritance in entity framework with code first

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 24

  • @harshpatel1515
    @harshpatel1515 6 ปีที่แล้ว +1

    one and only channel of internet .. for study entity entity framework .. properly.... thanks
    MR. kudvenkat

  • @androidsavior
    @androidsavior 6 ปีที่แล้ว

    Best teacher on the planet !

  • @shailendraphadke5557
    @shailendraphadke5557 10 ปีที่แล้ว +5

    I don't understand how "Discriminator" column created using code first approach? How Entity Framework understand it's data type? with it's specific size as well? please somebody answer me

    • @asterixgaul4725
      @asterixgaul4725 10 ปีที่แล้ว +1

      If I understand this, EF creates this based on the inheritance, since PM : E and CE : E

  • @PraveenKumar-vd4vd
    @PraveenKumar-vd4vd 7 ปีที่แล้ว +1

    How discriminator column is created in database table when there is no property corresponding to it in the entities(Employee, Permanent, Contract) created ? For e.g FistName column is created in database table which is referred from Employee entity, in similar fashion from which property discriminator column is referred? Please clarify. Thanks in advance!

    • @PraveenKumar-vd4vd
      @PraveenKumar-vd4vd 7 ปีที่แล้ว +1

      This link answers for the above question -> stackoverflow.com/questions/7393788/entity-framework-code-first-creates-discriminator-column

    • @harshpatel1515
      @harshpatel1515 6 ปีที่แล้ว

      thxx

  • @mywork-he1ke
    @mywork-he1ke 7 ปีที่แล้ว +2

    How this "Discriminator" column created without specifying into the code. Pls explain this Venket

  • @jumbo999614
    @jumbo999614 8 ปีที่แล้ว

    I have a question.
    When i choose radiobutton for either PermanentEmployee or ContractEmployee, their columns are not displayed in right order , except for 'All Employees'.
    First Column in Gridview doesn't start with ID.
    I notice that first few columns in gridview are the first properties in derived class
    do i have use DataTable to manually put columns in the way i want? (like in Convert method for 'All Employees')

  • @kartamd
    @kartamd 10 ปีที่แล้ว

    Keep posting Venkat, its awesome !!!

  • @chandruls193
    @chandruls193 9 ปีที่แล้ว +5

    can anyone pls explain that how discriminator column been created? I cant understand, any folks?

    • @PraveenKumar-vd4vd
      @PraveenKumar-vd4vd 7 ปีที่แล้ว +1

      This link answers for the above question -> stackoverflow.com/questions/7393788/entity-framework-code-first-creates-discriminator-column

  • @agkumar8732
    @agkumar8732 7 ปีที่แล้ว

    This video is not using entity framework. when I tried using entity frame work it was throwing errors as below
    Error 1 Cannot implicitly convert type 'TPHEFDBFMVC.Models.TPHEmployee' to 'TPHEFDBFMVC.Models.PermanentEmployee'. An explicit conversion exists (are you missing a cast?) D:\EntityFrameworkExamples\TPHEFDBFMVC\TPHEFDBFMVC\Controllers\PMEmployeeController.cs 30 51 TPHEFDBFMVC
    have any idea how to get out of this?

    • @crumbdav
      @crumbdav 7 ปีที่แล้ว

      a gouri kumar when you use DBContext and you set the DBSet to a class, you are using EntityFramework...

  • @ramchandrathakkar2022
    @ramchandrathakkar2022 10 ปีที่แล้ว +1

    I must say restless man for .net community..... Thanks...

  • @saagarsoni3
    @saagarsoni3 10 ปีที่แล้ว

    thnx a lot sir....very nicely explained

  • @roshandangol2897
    @roshandangol2897 5 ปีที่แล้ว

    Can anyone suggest me a way in which we can map foreign keys and navigation properties defined in the subclasses, while using TPH with fluent API? I will be really thankful.

  • @MohammedNoureldin
    @MohammedNoureldin 7 ปีที่แล้ว

    Actually I am confused between this and splitting the table into two entities, could some one tell me the main difference?

  • @crumbdav
    @crumbdav 4 ปีที่แล้ว

    Isn't the employee table supposed to be abstract?

  • @jacobcrosby101
    @jacobcrosby101 5 ปีที่แล้ว

    Thanks!

  • @sunnyokoro
    @sunnyokoro 10 ปีที่แล้ว

    Thank u so so much

  • @crumbdav
    @crumbdav 7 ปีที่แล้ว

    Why isnt the employee class abstract?

  • @zeeshanarif7378
    @zeeshanarif7378 7 ปีที่แล้ว

    What the hell You didn't Add a migration ??
    then hows the database created

    • @shaikhzoyeb
      @shaikhzoyeb 2 ปีที่แล้ว

      it gets automatically created because it has already been deleted