Menu

Entity Framework Core setting default database schema

Unless you set your default database schema in Entity Framework every thing will be created on the dbo. Since cloud hosting is expensive we are having one database for all our apps a but different schemas. You can do this schema like below.

Nice, if you are using CodeFirst now it create all the table in given schema, but you will notice that MigrationHistory table still in the dbo, that is alright as we do not have issue on migration with Entity Framework Core. But still I prefer to have project specific MigrationHistory table. you can do this by creating your own configuration like below.

Leave a comment