EF Core - Map dynamic columns to a list

Asked

Viewed 67 times

0

I need help in mapping EF Core entities.

I have table products and this table can contain different columns depending on customer customization, they will always be text columns. I have a table and an entity called Label where you tell me which column name in the product table. I need to map this to a Label list within the Product entity.

Product Table

-id

-title

-code a

-codigo_b

Table Label

-id -nomeColune title

I have the records in the label table:

1 - code a - code A

2 - code_b - code B

  • I didn’t quite understand what you need, could exemplify better?

  • See this gist: https://gist.github.com/eabreusantos/cf7383c1cd9f5fc166a31e3045c6b20d what I need is to map columns from msm table to a list in the entity, but which columns will be defined by records in another table.

  • It looks something like this: https://answall.com/questions/13015/howto support columns-addeds-by user-update-o-model-ofef?rq=1 but using the EF mapping itself.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.