This content is archived. See latest version here

Last updated: Oct 16 2014

Introduction

This section provides an information on how to use the Membership Registrar in EPiServer Commerce. Refer to Configuring membership provider for more information on to setup AspNet membership. See below for a description of how to configure Membership Registrar.

Example

This configuration requires the following NuGet packages as dependency:

  • EPiServer.Commerce.Security
C#
using EPiServer.Commerce.Security;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using EPiServer.Web;
using log4net;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web.Routing;
using System.Web.Security;

namespace WebApplication1
{
    [InitializableModule]
    [ModuleDependency(typeof(Mediachase.Commerce.Initialization.CommerceInitialization), typeof(EPiServer.Commerce.Initialization.InitializationModule))]
    public class InitializeCommerceSiteModule : IConfigurableModule
    {
        public void Initialize(InitializationEngine context)
        {
            
        }
				
        public void Preload(string[] parameters)
        { }

        public void Uninitialize(InitializationEngine context)
        { }

        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.Container.Configure(ce =>
            {
                ce.For<IRegistrar>().Singleton().Use<MembershipRegistrar>();
            });
        }
    }
}

See also


Do you have feedback on this documentation? Send an email to documentation@episerver.com. For development-related questions and discussions, refer to our Forums on https://world.episerver.com/forum/