- ABP Framework version: v7.3.3
- UI Type: Blazor WASM
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): yes
- Exception message and full stack trace:
- Steps to reproduce the issue:
Hi,
Can you please guide me of how to include a Blazor component from service A in service B?
In service A (CustomerService) we have a lot of CRUD forms as dialog components that we would like to reuse in service B (ProductService).
Can you please guide me?
Thanks, Carl
8 Answer(s)
-
0
Hi,
You can create a shared project and place components to reuse the Blazor components.
For example:
Component.Shared project:
DialogAComponent<p>This is a reuse Blazor component<p>Service A project
Service A Index page <DialogAComponent/>Service B project
Service B Index page <DialogAComponent/>Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thanks,
Do you have some example of how to do it? How to do deal with components that using AppServices? The shared project needs to be using AppServices I guess to be able to do CRUD operations?
Kind regards, Carl
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
The shared project can reference to the application project.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Ok, but why it is not possible to reference service a in service b? It is just the front-end client I mean. Bad practice or any other technical issues? In some projects I have seen only one big Blazor project, that communicate with the gateway. ABP MicroService have one top Blazor app, referencing to other Blazor project in the different services.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Yes you can.
But I recommend you create a shared project
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Yes you can.
But I recommend you create a shared project
Thanks, I understand but not the reason. Can you tell me please? :-)
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Because creating shared projects allows for better reuse of components, you may have other services that need to use these components in the future.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thanks, I got you and seems reasonable.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)