CodeFirst OnModelCreating isn't fired
Posted: Fri 20 Nov 2015 10:28
Hey
I use your latest EntityDeveloper Tool
I want to override the OnModelCreating method. Therefore I created a class with the following Code:
Entites is the class generated by the DbContext template (for VB.NET)
I see within VS 2015 that OnModelCreating has 1 Reference - The reference goes toe the OnModelCreating Sub within the Entites class.
But it is never called. - As I understand it right, this Method should be called, when the Class is created!?
THX for tips.
I use your latest EntityDeveloper Tool
I want to override the OnModelCreating method. Therefore I created a class with the following Code:
Code: Select all
Imports System.Data.Entity
Namespace Context
Public Class CreateModel
Inherits Entities
Protected Overrides Sub OnModelCreating(modelBuilder As DbModelBuilder)
modelBuilder.HasDefaultSchema("")
End Sub
End Class
End Namespace
I see within VS 2015 that OnModelCreating has 1 Reference - The reference goes toe the OnModelCreating Sub within the Entites class.
But it is never called. - As I understand it right, this Method should be called, when the Class is created!?
THX for tips.