Example #1
0
        /// <summary>
        /// Provider.ProviderBase Initialize Method.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="config"></param>
        public override void Initialize(string name, NameValueCollection config)
        {
            IContainer container = _configuration.Container;

            _roleProviderApplicationService       = container.Resolve <IRoleProviderApplicationService>();
            _membershipProviderApplicationService = container.Resolve <IMembershipProviderApplicationService>();

            //
            // Initialize values from web.config.
            //

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (string.IsNullOrEmpty(name))
            {
                name = "ShopgunRoleprovider";
            }

            if (String.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "Shopgun Role provider");
            }

            // Initialize the abstract base class.
            base.Initialize(name, config);


            if (config["applicationName"] == null || config["applicationName"].Trim() == "")
            {
                _applicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;
            }
            else
            {
                _applicationName = config["applicationName"];
            }


            if (config["writeExceptionsToEventLog"] == null)
            {
                return;
            }
            if (config["writeExceptionsToEventLog"].ToUpper() == "TRUE")
            {
                _pWriteExceptionsToEventLog = true;
            }
        }
        /// <summary>
        /// Provider.ProviderBase Initialize Method.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="config"></param>
        public override void Initialize(string name, NameValueCollection config)
        {
            IContainer container = _configuration.Container;
            _roleProviderApplicationService = container.Resolve<IRoleProviderApplicationService>();
            _membershipProviderApplicationService = container.Resolve<IMembershipProviderApplicationService>();

            //
            // Initialize values from web.config.
            //

            if (config == null)
                throw new ArgumentNullException("config");

            if (string.IsNullOrEmpty(name))
                name = "ShopgunRoleprovider";

            if (String.IsNullOrEmpty(config["description"]))
            {
                config.Remove("description");
                config.Add("description", "Shopgun Role provider");
            }

            // Initialize the abstract base class.
            base.Initialize(name, config);


            if (config["applicationName"] == null || config["applicationName"].Trim() == "")
            {
                _applicationName = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;
            }
            else
            {
                _applicationName = config["applicationName"];
            }


            if (config["writeExceptionsToEventLog"] == null) return;
            if (config["writeExceptionsToEventLog"].ToUpper() == "TRUE")
            {
                _pWriteExceptionsToEventLog = true;
            }
        }
Example #3
0
 public UserController(IMembershipProviderApplicationService membershipProviderApplicationService, IMentorApplicationService mentorApplicationService, IRoleProviderApplicationService roleProviderApplicationService)
 {
     _membershipProviderApplicationService = membershipProviderApplicationService;
     _roleProviderApplicationService = roleProviderApplicationService;
     _mentorApplicationService = mentorApplicationService;
 }
Example #4
0
 public RoleController(IRoleProviderApplicationService roleProviderApplicationService)
 {
     _roleProviderApplicationService = roleProviderApplicationService;
 }
Example #5
0
 public UserController(IMembershipProviderApplicationService membershipProviderApplicationService, IMentorApplicationService mentorApplicationService, IRoleProviderApplicationService roleProviderApplicationService)
 {
     _membershipProviderApplicationService = membershipProviderApplicationService;
     _roleProviderApplicationService       = roleProviderApplicationService;
     _mentorApplicationService             = mentorApplicationService;
 }
Example #6
0
 public RoleController(IRoleProviderApplicationService roleProviderApplicationService)
 {
     _roleProviderApplicationService = roleProviderApplicationService;
 }