Database first with Entity Framework Core ,oracle 11g (v11.2 ) and Scaffold-DbContext

asp.net-core c# entity-framework-core oracle

Question

I am trying to create Entity classes from already created oracle database by using Scaffold-DbContext. I used the following command to generate the same but I am getting just DbContext with no entity classes.

Scaffold-DbContext "Data Source=data-source;User ID=user-id;Password=****" Oracle.EntityFrameworkCore -OutputDir Models

I am unable to find a good source for EntityFramework core used with oracle. Can anyone please point me in the right direction. Thanks in advance.

1
0
12/27/2019 8:51:56 AM

Popular Answer

You can use the following. Change the variable per your requirements.

Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MYdb)));Persist Security Info=True;User Id=USER;Password=mypass;" Oracle.EntityFrameworkCore -OutputDir Models

Update:

Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=tcpcom.world)(PROTOCOL=tcp)(HOST={Host})(PORT={Port})))(CONNECT_DATA=(SID={SID}))); User ID={UserId};Password={Password}" {Provider} -o Models
0
12/27/2019 8:59:52 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow