Can I change the default schema name in entity framework 4.3 code-first?

前端 未结 5 910
野的像风
野的像风 2020-12-04 17:57

Currently I am deploying my application to a shared hosting environment and code-first with migrations has been working great except for one minor hiccup. Everytime I want t

5条回答
  •  盖世英雄少女心
    2020-12-04 18:25

    I would like to add since this is for C#, I have written one below for VB

    Public Class ClientDbContext
    Inherits DbContext
    Public Property Clients As DbSet(Of Client)
    
    Protected Overrides Sub OnModelCreating(modelBuilder As DbModelBuilder)
        modelBuilder.HasDefaultSchema("dbo")
    End Sub
    End Class
    

提交回复
热议问题