0

I have three tables in existing sql db:

  • Events
    • ConcreteEvents1
    • ConcreteEvents2

There is 1:1 relationship between events and concrete events and only events table has PrimaryKey.

Is there any way to scaffold entities from this database?

Unfortunately, I don't own the db

Liero
  • 25,216
  • 29
  • 151
  • 297
  • What exactly do you mean by scaffold entities? generate code based on database structure? – Joel Harkes Oct 08 '17 at 18:51
  • You can use cat factory and mock a database: https://www.codeproject.com/Articles/1160615/Generating-Code-for-EF-Core-with-CatFactory – H. Herzl Oct 08 '17 at 19:13
  • Yes. I think the cli command is called scaffold-dbcontext – Liero Oct 08 '17 at 19:14
  • It will not scaffold the entities properly since Concrete tables don't have PK defined. EntityType needs PK defined. – Smit Nov 17 '17 at 01:08

0 Answers0