daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ... Usings
  2. using Microsoft.AspNetCore.Identity.UI.Services;
  3. using MailSenderApp.Services;
  4.  
  5. namespace MailSenderApp {
  6.     public class Startup {
  7.        
  8.         // ... Startup initializer and other methods
  9.        
  10.         public void ConfigureServices(IServiceCollection services)
  11.         {
  12.             // ... Other services
  13.             services.AddDefaultIdentity<IdentityUser>().AddEntityFrameworkStores<ApplicationDbContext>();
  14.  
  15.             services.AddTransient<IEmailSender, EmailSender>(i =>
  16.                 new EmailSender(
  17.                     Configuration["EmailSender:Host"],
  18.                     Configuration.GetValue<int>("EmailSender:Port"),
  19.                     Configuration.GetValue<bool>("EmailSender:EnableSSL"),
  20.                     Configuration["EmailSender:UserName"],
  21.                     Configuration["EmailSender:Password"]
  22.                 )
  23.             );
  24.  
  25.             services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top