Skip to content

Instantly share code, notes, and snippets.

@A-Programmer
Created March 24, 2017 19:53
Show Gist options
  • Save A-Programmer/3e3dfd1a90034c47cc9adcd1e1f46a64 to your computer and use it in GitHub Desktop.
Save A-Programmer/3e3dfd1a90034c47cc9adcd1e1f46a64 to your computer and use it in GitHub Desktop.
ConfigureServices method
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
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