1
In my project, I have only a few entities that are not connected to the database, but I run some procedures through EF6.
These procs are only queries that bring data across information from more than one table.
Now I want to insert into the same project entities and tables repositories that already exist in the database.
How do I import this into code?
Wouldn’t be typing?
– Jéf Bueno
You can map your database tables to your application using the code first or through the database first
– Marco Souza
Do you use EF to persist the data or just to query VIEWS? And what would be a table repository?
– Aline
when I speak repository, it would be the class that would crud. I will use EF to persist, do Insert and query and show in the view. but I think I’ll create it all in the same hand. is that there are many tables, I thought I would have something more automated.
– Guilherme Camarotto
You can search @Marconciliosouza’s suggestion, with Code First or DB First. You will configure the connection and the EF generates for you the classes (tables) and the context...
– Aline
@Guilhermecamarotto, you can create a project separately and import your database to a repository through the database first, and then just copy your classes to your own project, the Database First generate the file. edmx which I believe is no longer supported in the Entity Framework Code. Where everything would now be based on Code First, so I advise you to already follow this path.
– Marco Souza
@Guilhermecamarotto, Code first allows among many things you to create a more friendly model in relation to its properties classes, because many databases have very ugly structures.
– Marco Souza
Good idea @Marconciliosouza, I will generate in another project and bring to my only what I need. thank you all for the tips.
– Guilherme Camarotto