Skip to content

Instantly share code, notes, and snippets.

@btodts
Created March 13, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btodts/2fc6e47e317baaf9e458125829665d3a to your computer and use it in GitHub Desktop.
Save btodts/2fc6e47e317baaf9e458125829665d3a to your computer and use it in GitHub Desktop.
ConfigureServices
namespace Foo.Infrastructure.EntityFramework
{
public static class ServiceCollectionExtensions
{
public static void AddDataAccessServices(this IServiceCollection services, string connectionString)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(connectionString));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment