Hello,
Is there any way to inject dynamic entity in service to write a common method to get data from any table? or any inbuilt method available? Purpose: We need to create common lookup service which can get data from any entity to reduce repeated code for lookup table/dropdown services.
Thanks
3 Answer(s)
-
0
The current design has no dynamic entity repository.
I think you can customize a service and use DbContext directly inside the service. This allows you to query using any entity.
-
0
Okay, How it can be done with DbContext in service, Is there any doc related to?
Thanks.
-
0
Try using IDbContextProvider, If you encounter any problems, please feedback.
https://github.com/aspnetboilerplate/aspnetboilerplate/blob/e0ded5d8702f389aa1f5947d3446f16aec845287/src/Abp.EntityFrameworkCore/EntityFrameworkCore/IDbContextProvider.cs#L6