Skip to content

Instantly share code, notes, and snippets.

@kevinrodriguez-io
Created June 12, 2018 07:00
Show Gist options
  • Save kevinrodriguez-io/a6fc05518426ca483c6fe77bf2d1857a to your computer and use it in GitHub Desktop.
Save kevinrodriguez-io/a6fc05518426ca483c6fe77bf2d1857a to your computer and use it in GitHub Desktop.
ASP.Net Core Identity UI 2.1 EmailSender registration on Startup.cs
// ... Usings
using Microsoft.AspNetCore.Identity.UI.Services;
using MailSenderApp.Services;
namespace MailSenderApp {
public class Startup {
// ... Startup initializer and other methods
public void ConfigureServices(IServiceCollection services)
{
// ... Other services
services.AddDefaultIdentity<IdentityUser>().AddEntityFrameworkStores<ApplicationDbContext>();
services.AddTransient<IEmailSender, EmailSender>();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment