Base solution for your next web application
Open Closed

Accessing Data outside of App Services #8376


User avatar
0
inforica created

Hi- We are building scheduled jobs infrastructure to run recurring batch jobs. My question is can we access backend data without calling the App Services by directly using repositories in a library project. The reason being batch jobs will have long run time instance and we do not want to load the Azure App Service where the API solution is deployed.

While we can use Hangfire, Quartz or Azure functions to schedule and trigger the job. I do not want App Service to be used for retrieval/update of data but instead use a custom library (dll) using Abp repositories directly to access/modify data. I assume this is feasible and aspnetzero architecture supports it.

   Please let us know..
   

Regards, Sesha K.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Yes, you can use ABP's repository function in a separate application.

    You need to create a DbConext based on the database, Depends on ABP's related modules. Such as abp entityframework module and so on. Configure the database connection string etc..

    This is similar to the console application. see: https://github.com/aspnetzero/aspnet-zero-samples/blob/master/ConsoleAppDemo/src/ConsoleAppDemo.ConsoleApplication/Program.cs#L23

    If your infrastructure is already in your solution, just reference the modules in your project.

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because of no recent activity. Please create a new issue if you are still having this problem.