Vignesh Pandi
Vignesh Pandi

Reputation: 359

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

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.

Upvotes: 1

Views: 3426

Answers (1)

Gauravsa
Gauravsa

Reputation: 6524

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

Upvotes: 1

Related Questions