Here's is the simple code I am using to test with:
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DevArtEFTest
{
class Program
{
static void Main(string[] args)
{
Database.SetInitializer(new DropCreateDatabaseAlways<DevArtContext>());
var drone = new Drone
{
Name = "Test Drone"
};
using (var ctx = new DevArtContext())
{
ctx.Drones.Add(drone);
ctx.SaveChanges();
}
if (System.Diagnostics.Debugger.IsAttached)
{
Console.Write("Any key to terminate... ");
Console.ReadKey(true);
}
}
}
public class Drone
{
public int DroneId { get; set; }
public string Name { get; set; }
}
public class DevArtContext : DbContext
{
public DbSet<Drone> Drones { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("DEMO");
modelBuilder.Entity<Drone>().Property(p => p.Name).HasMaxLength(100);
modelBuilder.Entity<Drone>().MapToStoredProcedures();
}
}
}
ORA-04043: object DEMO does not exist
If I comment out the HasDefaultSchema setting the error is (the name of the first of the three stored procedures to create):
ORA-04043: object "Drone_Insert" does not exist
Can anyone advise as to what I am doing wrong here?
Would any additional information be helpful?
Regards.