Created
March 11, 2020 20:03
-
-
Save masoodwasim/fd7b10a892a2f2553762e2fc48e4a3f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[assembly: WebJobsStartup(typeof(Startup))] | |
namespace SampleFunctionsApp | |
{ | |
public class Startup : IWebJobsStartup | |
{ | |
public void Configure(IWebJobsBuilder builder) | |
{ | |
builder.Services.AddLogging(loggingBuilder => | |
{ | |
loggingBuilder.AddFilter(level => true); | |
}); | |
var config = (IConfiguration)builder.Services.First(d => d.ServiceType == typeof(IConfiguration)).ImplementationInstance; | |
builder.Services.AddSingleton((s) => | |
{ | |
MongoClient client = new MongoClient(config["MONGO_CONNECTION_STRING"]); | |
return client; | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment