Base solution for your next web application
Open Closed

CRUD app services and generic repository instances without DI #6811


User avatar
0
mightyit created

Hi

I am currently developing some Azure functions (.Net 2.2, V2) and it's support for dependency injection is highly unstable (almost non-existant, atm). In addition, AspNetZero / ABP conventions will not apply to Azure functions.

In this scenario, I am forced to new up instances of app services, and perhaps domain services.

I would specifically like to find out how I can new up instances of Crud App Services and generic repositories?

Thanks


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mightyit

    I don't have any experience with Azure Functions but you can create a custom implementation of CrudAppService and instantiate it.

    But, it would be great if you can find a way to use DI in Azure Functions, otherwise it will be hard for you to use your app services.

    You can try property injection as explained here https://devkimchi.com/2019/02/22/performing-constructor-injections-on-azure-functions-v2/

  • User Avatar
    0
    mightyit created

    Oh fudge....

    Thanks. That was pretty much the approach I was trying to avoid, as it now means that "generic" services which the AspNetZero / ABP framework provides out-of-the-box can not be used.

    Also, I was trying to rely on DI for Azure Functions V2 - as you can see in that post it is still very unstable.

    Appreciate the input!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks for the feedback. We will try to better integrate AspNet Zero with Azure in the future.