GithubHelp home page GithubHelp logo

Comments (11)

ErikEJ avatar ErikEJ commented on June 19, 2024

Popular? I think you can run the Tool once specifying the individual physical paths.

At any rate in order to help I need a runnable repro as requested when you created this issue.

from efcorepowertools.

WalterB-MAMC avatar WalterB-MAMC commented on June 19, 2024

Not sure what I would put in a runnable repo as this is just a case of specifying where to put the files that the tool creates.

myApp.Domain
|--Entities
|  |-Movies.cs
|  |-Rentals.cs
|
myApp.Infrastructure
|--Data
|  |-dbContext.cs
|  |-Configurations
|    |-MoviesConfiguration.cs
|    |-RentalsConfiguration.cs

Now when I run the tool how can you get it to put the dbContext and the Configuration files in the myApp.Infrastructure project in the solution and then put the entities in the myApp.Domain project. If I add myApp.Domain.Entities when I run the tool from the Infrastructure project it will put the file in the myApp.Infrastructure.myApp.Domain.Entities folder that it will create. It does not understand that there are multiple projects in the solution.

Hope that helps, if not let me know.

Thanks.

from efcorepowertools.

ErikEJ avatar ErikEJ commented on June 19, 2024

Are you running the tool once or twice?

Also suggest you read the wiki docs for this advanced topic on file placement

from efcorepowertools.

WalterB-MAMC avatar WalterB-MAMC commented on June 19, 2024

The only way I can figure it out is to run it twice, once in the domain project, so that I can get the entities in the domain project and the run it again in the infrastructure project to get the dbcontext and the configuration files in the infrastructure project. If there is a way to run it once and have it put some files in one project and then put the other files in another project, I would love to know what the secret is. I looked at the wiki, but it is very limited on what all the options are for like the sub-namespaces and stuff. I did not find a way to do it. If I missed it, then I would love to know the secret.

from efcorepowertools.

ErikEJ avatar ErikEJ commented on June 19, 2024

You need to run it only once
Did you not see the extensive examples in the wiki?

from efcorepowertools.

WalterB-MAMC avatar WalterB-MAMC commented on June 19, 2024

I have been up and down the wiki and have not seen anything for splitting file outputs to two different projects in one solution. I must not know what I am looking for to find what I am trying to do if you say it is there. Do you have a link to where in the wiki this is at?

from efcorepowertools.

ErikEJ avatar ErikEJ commented on June 19, 2024

https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering#file-layout

from efcorepowertools.

WalterB-MAMC avatar WalterB-MAMC commented on June 19, 2024

That only works in the project that the tool is ran in. Because in the efpt.config.json file there is only one place for the project root namespace, "ProjectRootNamespace": "myApp.Infrastructure". If the files are seperated into two different projects in the solution this stops me from saying put the entities in project A and the dbContext and Configurations in project B. This also does not allow for the @Using myApp.Domain.Entities to be added to the dbContext or Configuration files as again the project root namespace is used, and sub-namespaces are appended to this.

For this to work we would need to add the ability to select the project to add the entities and dbContext and Configuration files to. Either by a dropdown box with the Project names or a textbox to type it in freely. Then the tools would need to make sure it adds the right @Using paths to the files as needed. Then we can use this tool to separate items as we see fit within the solution with multiple projects.

Hopefully this makes sense now and thanks for your help with the link.

from efcorepowertools.

ErikEJ avatar ErikEJ commented on June 19, 2024

You can set namespace both for entity classes and DbContext classes.

I need a full repro in order to help you further.

from efcorepowertools.

WalterB-MAMC avatar WalterB-MAMC commented on June 19, 2024

Ok, I figured out how to get the namespaces to work so that I can point to the right locations in my solution. The only issue is that you cannot just run this one time in the solution, it has to be ran twice, once in each project because I am splitting the models/entities in one project and then the dbContext and configurations in another project. I cannot figure out how it would run once and split this since it seems the tool is project oriented and not solution oriented.

Unless you know of a way to do this, I think it is a limitation of the tool. All you have to do is create a solution with two projects and then try to have the tool separate the items out like I have said and write to both projects. For now, I will just move on as I figured out something that was going to make me touch all the configuration files every time, I regenerated the files by running the reverse engineer process.

from efcorepowertools.

ErikEJ avatar ErikEJ commented on June 19, 2024

Cool.

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.