Created
May 29, 2019 04:48
-
-
Save jeffhollan/1f51c8ee2478af013e1c1311c4cb1966 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
using Microsoft.Azure.Functions.Extensions.DependencyInjection; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.DependencyInjection; | |
using System; | |
[assembly: FunctionsStartup(typeof(functions_csharp_entityframeworkcore.Startup))] | |
namespace functions_csharp_entityframeworkcore | |
{ | |
class Startup : FunctionsStartup | |
{ | |
public override void Configure(IFunctionsHostBuilder builder) | |
{ | |
string SqlConnection = Environment.GetEnvironmentVariable("SqlConnectionString"); | |
builder.Services.AddDbContext<BloggingContext>( | |
options => options.UseSqlServer(SqlConnection)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment