Created
July 9, 2016 08:16
-
-
Save flagshipxyz/2b2fe7b5ceb17c4ba3e61c09f59f6a2c to your computer and use it in GitHub Desktop.
asp.net core:データベース接続先の設定
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
// Add framework services. | |
services.AddDbContext<ApplicationDbContext>(options => | |
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection"))); | |
//services.AddDbContext<ApplicationDbContext>(options => | |
// options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); | |
services.AddIdentity<ApplicationUser, IdentityRole>() | |
.AddEntityFrameworkStores<ApplicationDbContext>() | |
.AddDefaultTokenProviders(); | |
services.AddMvc(); | |
// Add application services. | |
services.AddTransient<IEmailSender, AuthMessageSender>(); | |
services.AddTransient<ISmsSender, AuthMessageSender>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment