<<назад Configuration.vb (Contoso University).
1: Imports System
2: Imports System.Data.Entity
3: Imports System.Data.Entity.Migrations
4: Imports System.Linq
5:
6: Namespace Migrations
7:
8: Friend NotInheritable Class Configuration
9: Inherits DbMigrationsConfiguration(Of SchoolContext)
10:
11: Public Sub New()
12: AutomaticMigrationsEnabled = False
13: End Sub
14:
15: Protected Overrides Sub Seed(context As SchoolContext)
16: Data.DbInitializer.Initialize(context)
17: ' This method will be called after migrating to the latest version.
18:
19: ' You can use the DbSet(Of T).AddOrUpdate() helper extension method
20: ' to avoid creating duplicate seed data.
21: End Sub
22:
23: End Class
24:
25: End Namespace
Comments (
)
Link to this page:
//www.vb-net.com/EF-missing-FAQ/Code/Configuration.vb.htm
|