Azure / Azure-Functions

1.12k stars 199 forks source link

Azure Functions with .Net Core 2.1 and DI #782

Open sonphnt opened 6 years ago

sonphnt commented 6 years ago

Hi Everyone,

I have a WebAPI .Net Core 2.0 project with plenty of methods. Do we have any good example that show the correct way of doing Dependency Injection in Azure Function.

I think Azure Function should support a generic way of calling a method from Generic project. For Example: I have a GenericProject with my own code in there. In Azure Function, I would like to do some things like this.

Function1: GenericProject.CleanUpOldCustomerFromDatabase(); Function2: GenericProject.GenerateCustomerBilling(); Function3: GenericProject.SendEmailToNewCustomer():

Function 1-2-3 can be a Http trigger or Timer trigger Then My functions will be very thin. I can consolidate my business code into 1 place (project) instead of spreading into multiple Azure Functions.

Thanks

ColbyTresness commented 5 years ago

@fabiocav for DI (I assume you have another issue tracking this work)