Entity Framework Core + Oracle (edit)

  1. Update Model from Database...
  2. Generate Database from Model...

Entity Framework, LINQ and Model-First for the Oracle Database

https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkOBE/EntityFrameworkOBE.htm

Entity Framework Core tools reference - .NET Core CLI

https://docs.microsoft.com/en-us/ef/core/cli/dotnet

dotConnect for Oracle

https://www.devart.com/dotconnect/oracle/articles/efcore-database-first-net-core.html

Starting with an existing database

https://www.learnentityframeworkcore.com/walkthroughs/existing-database

Oracle DB First

https://www.devart.com/dotconnect/oracle/articles/efcore-database-first-net-core-entity-developer.html

Oracle Command - Inserting Data in Run Time

https://www.devart.com/dotconnect/oracle/articles/tutorial-command.html

To insert the first row into table dept you can use the following statement:

  1. CREATE TABLE dept:

    CREATE TABLE dept (
      deptno INT PRIMARY KEY,
      dname VARCHAR(14),
      loc VARCHAR(13)
    )
    
  2. CREATE TABLE emp:

    CREATE TABLE emp (
      empno INT PRIMARY KEY,
      ename VARCHAR(10),
      job VARCHAR(9),
      mgr INT,
      hiredate DATE,
      sal FLOAT,
      comm FLOAT,
      deptno INT REFERENCES dept
    )
INSERT INTO dept (deptno, dname, loc) VALUES (10,'Accounting','New York')

The following code fragment executes the query:

OracleConnection conn = new OracleConnection("User Id=scott;Password=tiger;Server=OraServer;");
OracleCommand cmd = new OracleCommand();
cmd.CommandText = "INSERT INTO dept (deptno, dname, loc) VALUES (10,'Accounting','New York')";
cmd.Connection = conn;
conn.Open();
try {
  int aff = cmd.ExecuteNonQuery();
  MessageBox.Show(aff + " rows were affected.");
}
catch {
  MessageBox.Show("Error encountered during INSERT operation.");
}
finally {
  conn.Close();
}

Console Application - How You Can Create a .NET Core Application Using Entity Framework Core with Oracle

https://www.talkingdotnet.com/create-net-core-application-using-entity-framework-core-with-oracle/

  1. Update Model From Database...
  2. Update Database from Model...
  3. Generate Database Script From Model...

Create a .NET Core Application Using Entity Framework Core with Oracle