public OrderRepositery(ApplicationDbContext _context, IHostingEnvironment hostingEnvironment, UserManager <ApplicationUser> userManager, IHubContext <NotificationHub> _hubContext, IDataProtectionProvider dataProtectionProvider, DataProctectionPurposeString dataProtectionPurposeStrings, ILogger <OrderRepositery> _logger) { context = _context; util = new utilities(context, hostingEnvironment); Usermanager = userManager; this._hubContext = _hubContext; this.protector = dataProtectionProvider.CreateProtector( dataProtectionPurposeStrings.OrderId); logger = _logger; }
// It is the CreateProtector() method of IDataProtectionProvider interface // that creates an instance of IDataProtector. CreateProtector() requires // a purpose string. So both IDataProtectionProvider and the class that // contains our purpose strings are injected using the contructor public OrderController(IorderRepositery IorderRepository, ApplicationDbContext context, IHostingEnvironment hosting, UserManager <ApplicationUser> _userManager, Microsoft.AspNetCore.Identity.UI.Services.IEmailSender emailSender, IDataProtectionProvider dataProtectionProvider, DataProctectionPurposeString dataProtectionPurposeStrings) { iOrderRepositery = IorderRepository; userManager = _userManager; util = new utilities(context, hosting); _emailSender = emailSender; this.protector = dataProtectionProvider.CreateProtector( dataProtectionPurposeStrings.OrderId); }