Is it possible to force EF 6 to create a sql server database in a specific folder rather than the standard folder in a code first scenario? I have done quite a few searches but could not find any useful information. Thanks.
PS:
connection string:
<add name="BlaDbContext" connectionString="Data Source=127.0.0.1,1234;Initial Catalog=xxx;User Id=xxx;Password=xxx;" providerName="System.Data.SqlClient" />
Also tried to include DataDirectory and manipulate it from my console app as suggested by Steve Greene.
PPS:
Also tried:
context.Database.ExecuteSqlCommand(TransactionalBehavior.DoNotEnsureTransaction,
@" ALTER DATABASE [DB] MODIFY FILE
(
Name = DB,
Filename = 'D:\Databases\DB.mdf'
);
ALTER DATABASE [DB] MODIFY FILE
(
Name = DB_log,
Filename = 'D:\Databases\DB_log.ldf'
);
");