Code Monkey home page Code Monkey logo

Comments (10)

tonysneed avatar tonysneed commented on September 13, 2024

Digging around I didn't see any way to prefix the schema
Have you seen the Schema Folders feature?

services.AddHandlebarsScaffolding(options =>
{
    // Put Models into folders by DB Schema
    options.EnableSchemaFolders = true;
});

Does this meet your need?

from entityframeworkcore.scaffolding.handlebars.

CDMayberry avatar CDMayberry commented on September 13, 2024

Ah I have seen that and it's handy but doesn't quite fit the bill. I was explicitly asked to prefix the class name with the schema by the lead developer. It would also help with the fact we have a bunch of duplicate table names across schemas, so being able to prefix might fix some of the Table, Table1, Table2, naming issues we run into.

from entityframeworkcore.scaffolding.handlebars.

tonysneed avatar tonysneed commented on September 13, 2024

Have a look at the sample app and you'll see that DB schema names are represented as folders, which adds the schema to the namespace for each class within that namespace. This solves the problem of duplicate table names across schemas, because they are disambiguated by namespace, which is how it's done in C#.

from entityframeworkcore.scaffolding.handlebars.

CDMayberry avatar CDMayberry commented on September 13, 2024

Ah I probably just muddied the waters mentioning duplicate tables. I had wanted to use schema folders, but it isn't up to me. My team lead is having to compromise between moving to modern .Net standards while keeping to some of the company's older, custom conventions. In this case, he opted to prefix schema names to entities to keep with the custom conventions.

I could go into more detail but in the end we were hoping for more control over naming entities. That said if that's not something you think would be good to allow no worries. I can make my own fork for this specific project.

from entityframeworkcore.scaffolding.handlebars.

ErikEJ avatar ErikEJ commented on September 13, 2024

@CDMayberry EF Core Power Tools allows you to do custom naming

from entityframeworkcore.scaffolding.handlebars.

CDMayberry avatar CDMayberry commented on September 13, 2024

@CDMayberry EF Core Power Tools allows you to do custom naming

Ah I do keep forgetting about that, I'll consider that in the future. In this case I've used this Handlebars.Net + this in the past at other companies and really liked it. We had started to use it at my current company when I learned we needed to change how naming is handled. I wanted to see if this library was open to making that change before I look at other options.

from entityframeworkcore.scaffolding.handlebars.

tonysneed avatar tonysneed commented on September 13, 2024

from entityframeworkcore.scaffolding.handlebars.

CDMayberry avatar CDMayberry commented on September 13, 2024

I've got a couple of ideas, I'll spin up a fork and see if I can make it work.

from entityframeworkcore.scaffolding.handlebars.

johnwc avatar johnwc commented on September 13, 2024

We also need this functionality as well. Can we also get the ability to know what the foreign table is in these property transformers, like the constructor and nav transformers? We really need to be able to know what the property's foreign table is in the relationship, so we know what to rename the types and property names correctly to.

from entityframeworkcore.scaffolding.handlebars.

tonysneed avatar tonysneed commented on September 13, 2024

Closed #233 pending the .NET 8 upgrade. @mwmccallum, When you have time, we can circle back to have a look at this feature request.

from entityframeworkcore.scaffolding.handlebars.

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.