/// <summary> /// Adoptions Controller Constructor /// </summary> /// <param name="context">AdotAquiDbContext</param> /// <param name="userManager">UserManager</param> /// <param name="notificatonService">NotificationService</param> /// <param name="emailSender">EmailSender</param> public AdoptionsController(AdotAquiDbContext context, UserManager <User> userManager, INotificationService notificatonService, IEmailSender emailSender) { _context = context; _userManager = userManager; _notificationService = notificatonService; _emailSender = emailSender; }
/// <summary> /// Used to register a new notification, can send email /// </summary> /// <param name="context">AdotAquiDbContext</param> /// <param name="notification">Notification Details</param> /// <param name="emailService">Email Details (optional)</param> public void Register(AdotAquiDbContext context, UserNotification notification, IEmailSender emailService = null) { context.UserNotification.Add(notification); context.SaveChanges(); if (emailService != null) { var user = context.Users.Find(notification.UserId); emailService.SendEmailAsync(user.Email, "Nova Notificação", "Olá, <p>Gostariamos de informar que tem uma nova notificação!</p><p>Visite <a href='http://eswapp.azurewebsites.net/'>Adotaqui</a> para mais detalhes</p>"); } }
public ManageController( AdotAquiDbContext context, UserManager <User> userManager, SignInManager <User> signInManager, IEmailSender emailSender, ISmsSender smsSender, ILoggerFactory loggerFactory) { _context = context; _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _smsSender = smsSender; _logger = loggerFactory.CreateLogger <ManageController>(); }
public AccountController( AdotAquiDbContext context, UserManager <User> userManager, SignInManager <User> signInManager, IEmailSender emailSender, ISmsSender smsSender, ILoggerFactory loggerFactory, IStringLocalizer <SharedResources> sharedLocalizer, IHttpContextAccessor httpContextAccessor) { _context = context; _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _smsSender = smsSender; _logger = loggerFactory.CreateLogger <AccountController>(); _localizer = sharedLocalizer; _httpContextAccessor = httpContextAccessor; }
/// <summary> /// AnimalComments Constructor /// </summary> /// <param name="context">AdotAquiDbContext</param> public AnimalCommentsController(AdotAquiDbContext context) { _context = context; }
/// <summary> /// Users Constructor /// </summary> /// <param name="context">AdotAquiDbContext</param> public UsersController(AdotAquiDbContext context) { _context = context; }
public HomeController(AdotAquiDbContext context, IHttpContextAccessor httpContextAccessor) { _context = context; _httpContextAccessor = httpContextAccessor; }
internal void InitializeDatabaseWithDataTest() { _context = new AdotAquiDbContext(_options); }
/// <summary> /// UserNotifications Constructor /// </summary> /// <param name="context"></param> /// <param name="userManager"></param> public UserNotificationsController(AdotAquiDbContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
/// <summary> /// Log Constructor /// </summary> /// <param name="context">AdotAquiDbContext</param> public LogsController(AdotAquiDbContext context) { _context = context; }