コード例 #1
0
        internal override void Initialize()
        {
            try
            {
#pragma warning disable CS0436 // Type conflicts with imported type
                //SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
#pragma warning restore CS0436 // Type conflicts with imported type


                OnBeforeInitialize();



                var od = OriginalSqlDatabase <TDbContext> .GetInstance(() => Version);

                TempFiles.Add(od.DbFile);
                TempFiles.Add(od.LogFile);


                DBName = od.DBName;

                ConnectionString = (new SqlConnectionStringBuilder()
                {
                    DataSource = "(localdb)\\MSSQLLocalDB",
                    //sqlCnstr.AttachDBFilename = t;
                    InitialCatalog = od.DBName,
                    IntegratedSecurity = true,
                    ApplicationName = "EntityFramework"
                }).ToString();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
                throw;
            }
        }