/// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <param name="applicationUserContext"></param>
        /// <returns></returns>
        public async Task Invoke(HttpContext context, CurrentApplicationUserService currentApplicationUserService)
        {
            var userId = context.User.FindFirst("UniqueUserIndentifier")?.Value;

            if (!String.IsNullOrWhiteSpace(userId))
            {
                currentApplicationUserService.SetCurrentUser(userId);
            }

            await next(context);
        }
Example #2
0
 public CoreContext(DbContextOptions <CoreContext> options, CurrentApplicationUserService currentApplicationUserService)
     : base(options)
 {
     _currentApplicationUserService = currentApplicationUserService;
 }