Use static C# api clients in a regular .NET 8 app #18626
-
I created an web app with ABP framework, and I am developing another .NET 8 client app which doesn't use ABP Framework, I would like the client app to use all contracts I defined in the web app so I followed Static C# API Client Proxies. The doc says
But in the doc it requires me to use AbpModule in the client app
I also googled and found all example videos regarding consuming ABP web apis are done by using the HttpApi.Client.ConsoleTestApp which is already an AbpModule. I'm confused, does it mean the static C# api client proxies generated by ABP can only be consumed in another ABP application? I would prefer to use a regular .NET 8 app to consume the http api and I do not want to handle data serialization/deserialization by myself, I can add Volo.Abp.Http.Client package to this project through. Could anyone provide me a guidance for me? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hi You can bootstrap an abp module system into your project. It doesn't require many module dependencies. |
Beta Was this translation helpful? Give feedback.
-
For anyone who is new to ABP framework, and is facing the same problem as I did, bootstraping abp module system into the project is the right way to go, here're more details.
Specifically for .NET worker application, since ABP also provides BackgroundWorker which is similar to BackgroundService, you may consider updating your existing background services to take advantages of auto trigger for configurable timer interval and also exception handling etc, that's totally up to you and it's totally fine to continue using the BackgroundService. After adding ABP core system into your project, you may follow Dynamic C# API Client Proxies to inject the app services from another ABP application into your application services. |
Beta Was this translation helpful? Give feedback.
hi
You can bootstrap an abp module system into your project. It doesn't require many module dependencies.