-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the Clean Architect structure, I need to split dbcontext and entities into multiple projects. #2283
Comments
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. |
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.
Now when I run the tool how can you get it to put the dbContext and the Configuration files in the Hope that helps, if not let me know. Thanks. |
Are you running the tool once or twice? Also suggest you read the wiki docs for this advanced topic on file placement |
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. |
You need to run it only once |
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? |
That only works in the project that the tool is ran in. Because in the 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 Hopefully this makes sense now and thanks for your help with the link. |
You can set namespace both for entity classes and DbContext classes. I need a full repro in order to help you further. |
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. |
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 |
Using the Clean Architecture I need to split the output of this tool into multiple projects and reference them from each project. So, let's say that I am going to put the entities in
myApp.Domain
project and the DBContext and Configurations in themyApp.Infrastructure
project. Here I will need to have the DBContext and the Configuraiton files refernece@Using myApp.Infrastructure.Entities
when using a sub namespace for the entities. Right now I can run the tool on both projects but then, I have to go into each file and manually change all the references.This being a popular architecture, among others that split this up, is there a way that the tool can allow for different projects and add the references as needed?
The text was updated successfully, but these errors were encountered: