Database.tt 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <#@ include file="PetaPoco.Core.ttinclude" #>
  2. <#
  3. // Settings
  4. ConnectionStringName = ""; // Uses last connection string in config if not specified
  5. Namespace = "";
  6. RepoName = "";
  7. GenerateOperations = true;
  8. GeneratePocos = true;
  9. GenerateCommon = true;
  10. ClassPrefix = "";
  11. ClassSuffix = "";
  12. TrackModifiedColumns = false;
  13. ExplicitColumns = true;
  14. ExcludePrefix = new string[] {}; // Exclude tables by prefix.
  15. // Read schema
  16. var tables = LoadTables();
  17. /*
  18. // Tweak Schema
  19. tables["tablename"].Ignore = true; // To ignore a table
  20. tables["tablename"].ClassName = "newname"; // To change the class name of a table
  21. tables["tablename"]["columnname"].Ignore = true; // To ignore a column
  22. tables["tablename"]["columnname"].PropertyName="newname"; // To change the property name of a column
  23. tables["tablename"]["columnname"].PropertyType="bool"; // To change the property type of a column
  24. */
  25. // Generate output
  26. if (tables.Count>0)
  27. {
  28. #>
  29. <#@ include file="PetaPoco.Generator.ttinclude" #>
  30. <# } #>