Solution for this is, add the below code in DBContext constructor or Application_Start method in Global.asax class.
Reason for this error is, each time DBContext object initializes the Entity Framework was trying to create Oracle table under user that does not have permissions. If you work with existing database disable the initializer like mentioned below. Otherwise each table will be recreated based on C# class definition.
public EmployeeDbContext(): base("name=OracleConnection") { Database.SetInitializerOr,(null); }
protected void Application_Start(Object sender, EventArgs e) { Database.SetInitializer(null); }
No comments:
Post a Comment