コード例 #1
0
 public CosmosDBMembership(IHttpContextAccessor context, CustomMembershipOptions options,
                           IUserRepository userRepository,
                           ISessionRepository sessionRepository)
 {
     _context           = context;
     _userRepository    = userRepository;
     _sessionRepository = sessionRepository;
     Options            = options;
 }
コード例 #2
0
        public static IServiceCollection AddCustomMembership <T>(this IServiceCollection services, Action <CustomMembershipOptions> options)
            where T : class, ICustomMembership
        {
            services.AddTransient <ICustomMembership, T>();
            services.AddTransient <CustomMembershipOptions>((s) => {
                var opts = new CustomMembershipOptions();
                options(opts);
                return(opts);
            });

            return(services);
        }