Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen creating a view for an original table, how to use the same FK to another table in entity framework fluent mapping
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COChildEntity, for table Child has the TableEntityId column, and it is a real FK to Table (for TableEntity entity), but since ViewEntity is for a View that has all the columns of Table plus a few more, I need it to also be able to reference ChildEntity by TableEntityId (so I can load a bunch of Child records to Table into my ViewEntity's ChildEntities collection). I hope I'm making sense here.
      singulars
    2. COIf you need the `TableEntity` only for create/update/delete you could read and display `ViewEntity`s and attach to the `TableEntities` set in the context for CUD actions.
      singulars
    3. COHow would I go about doing that - I sort of tried adding a property to ViewEntity called TableEntity and a property to TableEntity called ViewEntity so they could reference each other. And then I added this as a mapping to my context: modelBuilder.Entity<TableEntity>().HasRequired(e => e.ViewEntity).WithMany().HasForeignKey(e => e.Id); ...but I get an exception doing that (I think maybe because Id on ViewEntity somehow gets set as a primary key in my mapping ..Id on ViewEntity and TableEntity are the same)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload