Hello,
If I want to organize my code in solution folders, where every solution folder has its own .Core, .Application, .EntityFramework.
Do you have a VS template to create a new module?
For instance, if I want my ModuleX to define some permissions, am I supposed to only added them in the main .Core project, or I can add them in the .Core of my ModuleX?
Reason, why I am asking for this is, I want to keep the framework code untouched and do my work in some other modules, so that I might have it easier to upgrade the framework code when a new release is out.
Thanks Bilal
7 Answer(s)
-
0
Hi,
We don't have it at the moment but it is in our future plans.
-
0
Good to know.
Any guides now on how to do that manually? Steps involved, references, etc.
-
0
Hi,
Actually we don't have such a document, you have to do it manually by yourself. If you have any problems on the way, we can help you for specific problems.
Thanks.
-
0
So, let me share with you steps:
- Create a new Solution Folder
- Create .Core, .Application and .EntityFramework class libraries
- Add needed class references, etc.
- Make the main Web Module depend on the custom .Application module?
Is that it?
Thanks
-
0
We do this in ours. It would take me a bit of time to document everything but this is very doable. In every project, I have a Module and a CustomDtoMapper class at the root. I took this from the framework's Application project. I like this so I use that same thing when I create my own project.
In our Core project, we implemented our own Authorization provider (inherit from AuthorizationProvider just like theirs does) and in that projects Module, just call Configuration.Authorization.Providers.Add<MyAuthorizationProvider>();
Make your Modules dependent on their module. As an example, in your Core project's Module, add a DependsOn for the frameworks Core module. Make sense?
You will need to wire up the API parsing inside the WebAPI project. This is the big one that converts the AppServices to WebAPI methods. Search for DynamicApiControllerBuilder and you can see where they registered their Application Module. You will need to add a DependsOn your Application module here also.
Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder .ForAll<IApplicationService>(typeof(MyApplicationModule).Assembly, "app") .Build();
Not sure you can get away with Multiple EF projects. Just keep that as one. Unless you had separate DbContext classes, I don't see how this would help a ton. I move all their Migrations into a sub folder in the Migrations folder to keep their migrations separate from mine. This helps to keep things separate on the EF side. Other than that, never had any issues with this approach.
We also have our own SettingsProvider. We register that in the Web Module. As you go, it's pretty easy to figure out what they did to copy. I will say that we can keep from changing the framework stuff about 90% of the time. Sometimes it's impossible to avoid changing the framework code.
Hope that helps a little. If you just start to create your own Application and Core project, you will figure it out pretty quick.
-
0
Thanks @JeffMH, you are great :)
-
0
Thanks @JeffMH. i will follow the steps and see how it goes.