Example #1
0
        private void CreateDataFiles()
        {
            AssemblyResource.FromAssembly(GetType().Assembly, "TestDatabase.mdf").SaveToDisk(DataFile.FullName);
            AssemblyResource.FromAssembly(GetType().Assembly, "TestDatabase_log.ldf").SaveToDisk(LogFile.FullName);

            DataFile.Refresh();
            LogFile.Refresh();
        }
        private FileInfo SaveToDisk(string resourceName, string directoryPath, string databaseName)
        {
            var filePath = Path.Combine(directoryPath, resourceName.Replace("TestDatabase", databaseName));

            return(AssemblyResource.FromAssembly(GetType().Assembly, resourceName).SaveToDisk(filePath));
        }