(MVC) MVC (2018)

<<назад 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 ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23
Link to this page: //www.vb-net.com/EF-missing-FAQ/Code/Configuration.vb.htm
<SITEMAP>  <MVC>  <ASP>  <NET>  <DATA>  <KIOSK>  <FLEX>  <SQL>  <NOTES>  <LINUX>  <MONO>  <FREEWARE>  <DOCS>  <ENG>  <CHAT ME>  <ABOUT ME>  < THANKS ME>