private void SetUpRepositories()
 {
     ContractorRepository = kernel.Get<IContractorRepository>();
     DeviceRepository = kernel.Get<IDeviceRepository>();
     FixedAssetRepository = kernel.Get<IFixedAssetRepository>();
     KindRepository = kernel.Get<IKindRepository>();
     LicenceRepository = kernel.Get<ILicenceRepository>();
     PeripheralDeviceRepository = kernel.Get<IPeripheralDeviceRepository>();
     PersonRepository = kernel.Get<IPersonRepository>();
     SectionRepository = kernel.Get<ISectionRepository>();
     SubgroupRepository = kernel.Get<ISubgroupRepository>();
     MembershipRoleRepository = kernel.Get<IMembershipRoleRepository>();
     MembershipUserRepository = kernel.Get<IMembershipUserRepository>();
 }
        public RoleProvider()
        {
            string assembly = String.Empty;
            string repositoryType = String.Empty;

            System.Configuration.Configuration configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
            System.Web.Configuration.RoleManagerSection roleSection = (System.Web.Configuration.RoleManagerSection)configuration.GetSection("system.web/roleManager");

            foreach (System.Configuration.ProviderSettings p in roleSection.Providers)
            {
                if (p.Name == roleSection.DefaultProvider)
                {
                    assembly = p.Parameters["repositoryAssembly"];
                    repositoryType = p.Parameters["repository"];
                }
            }

            Assembly thisAssembly = Assembly.GetAssembly(typeof(RoleProvider));
            string currentAssembly = thisAssembly.FullName;

            try
            {
                if (assembly != currentAssembly)
                    thisAssembly = Assembly.Load(assembly);
            }
            catch (Exception e)
            {
                throw new ApplicationException("Inspira RoleProvider: Error loading the repository's assembly.", e);
            }

            try
            {
                Type repType = thisAssembly.GetType(repositoryType);
                repository = (IMembershipRoleRepository)Activator.CreateInstance(repType, true);

            }
            catch (Exception e)
            {
                throw new ApplicationException("Inspira RoleProvider: Error creating an instance of the repository.", e);
            }
        }
Example #3
0
 public MembershipRoleService(IMembershipRoleRepository membershipRoleRepository)
 {
     _membershipRoleRepository = membershipRoleRepository;
 }
Example #4
0
 public WebUserProfile()
 {
     _membershipUserRepository = IoC.Resolve <IMembershipUserRepository>();
     _membershipRoleRepository = IoC.Resolve <IMembershipRoleRepository>();
     _systemSettings           = IoC.Resolve <ISystemSettings>();
 }
 public MembershipRoleController(IMembershipRoleRepository repo)
 {
     repository = repo;
 }