Giter Site home page Giter Site logo

Comments (3)

ErikEJ avatar ErikEJ commented on July 24, 2024

@jan-diputado Please ask the Handlebars questions in the Handlebars repo.

For T4, they certainly supports multiple sets of templates.

Please refer to the wiki, and "The tool just breaks" is not a useful error report.

from efcorepowertools.

jan-diputado avatar jan-diputado commented on July 24, 2024

@ErikEJ, Sorry, I should have put more details; I was hopeful that there was a handlebars solution.

For T4 approach, I don't understand what is to be placed in T4 template path; I tried the following on my project:

..\..\
DB1
DB1\CodeTemplates
DB1\CodeTemplates\EFCore
DB1\CodeTemplates\EFCore\
/DB1/CodeTemplates/EFCore

but none of them worked. The CodeTemplates\EFCore folders are not created.

It only works when the path is blank.
Then, when I move the folder to the correct location and change the T4 template path, the tool just ignores it and places all models and db context on the base folder (DB1 folder), instead of folder paths I defined on the tool.

Below is the content of efpt.db1.config.json

{
   "CodeGenerationMode": 3,
   "ContextClassName": "DB1Context",
   "ContextNamespace": null,
   "FilterSchemas": false,
   "IncludeConnectionString": false,
   "ModelNamespace": null,
   "OutputContextPath": "DB1\\Context",
   "OutputPath": "DB1\\Models\\Entities",
   "PreserveCasingWithRegex": true,
   "ProjectRootNamespace": "Project1.EntityFrameworkCore",
   "Schemas": null,
   "SelectedHandlebarsLanguage": 2,
   "SelectedToBeGenerated": 0,
   "T4TemplatePath": "DB1\\CodeTemplates\\EFCore\\",
   "Tables": [
      {
         "Name": "[dbo].[TAB1]",
         "ObjectType": 0
      },
      {
         "Name": "[dbo].[TAB2]",
         "ObjectType": 0
      }
   ],
   "UiHint": null,
   "UncountableWords": null,
   "UseAsyncStoredProcedureCalls": true,
   "UseBoolPropertiesWithoutDefaultSql": false,
   "UseDatabaseNames": true,
   "UseDateOnlyTimeOnly": false,
   "UseDbContextSplitting": false,
   "UseDecimalDataAnnotationForSprocResult": true,
   "UseFluentApiOnly": true,
   "UseHandleBars": false,
   "UseHierarchyId": false,
   "UseInflector": false,
   "UseLegacyPluralizer": false,
   "UseManyToManyEntity": false,
   "UseNoDefaultConstructor": false,
   "UseNoNavigations": false,
   "UseNoObjectFilter": false,
   "UseNodaTime": false,
   "UseNullableReferences": false,
   "UsePrefixNavigationNaming": false,
   "UseSchemaFolders": false,
   "UseSchemaNamespaces": false,
   "UseSpatial": false,
   "UseT4": true
}

Let me know if you need more info.

from efcorepowertools.

ErikEJ avatar ErikEJ commented on July 24, 2024

@jan-diputado Thanks.

The path should point to a folder where there is a CodeTemplates folder below, I have updated the docs

If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship

from efcorepowertools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.