public void SchemaNameShouldBeUsed() { string schemaName = "TheSchemaName_".RandomLetters(5); DaoRepository repo = new DaoRepository(new SQLiteDatabase(".", MethodBase.GetCurrentMethod().Name), Log.Default, schemaName); repo.WarningsAsErrors = false; repo.AddType <Parent>(); Assembly daoAssembly = repo.GenerateDaoAssembly(); Type type = daoAssembly.GetTypes().FirstOrDefault(t => t.HasCustomAttributeOfType <TableAttribute>()); Expect.IsNotNull(type); Expect.AreEqual(schemaName, Dao.ConnectionName(type)); }
public static void GenerateDaoForTypes() { GenerationInfo genInfo = GetDaoGenerationInfo(); Assembly typeAssembly = genInfo.Assembly; string schemaName = genInfo.SchemaName; string fromNameSpace = genInfo.FromNameSpace; string toNameSpace = genInfo.ToNameSpace; DaoRepository repo = new DaoRepository(new SQLiteDatabase(".", schemaName), new ConsoleLogger(), schemaName); repo.DaoNamespace = toNameSpace; repo.AddNamespace(typeAssembly, fromNameSpace); Assembly daoAssembly = repo.GenerateDaoAssembly(false); FileInfo fileInfo = daoAssembly.GetFileInfo(); string copyTo = Path.Combine(GetArgument("writeTo", "Please enter the directory to copy the resulting assembly to"), fileInfo.Name); fileInfo.CopyTo(copyTo, true); OutLineFormat("File generated:\r\n{0}", copyTo); Pause("Press enter to continue..."); }