コード例 #1
0
            protected override void EstablishContext()
            {
                XmlConfigurator.Configure();
                RegisterDependencies();

                ClaimsPrincipal.ClaimsPrincipalSelector =
                    () => EdFiClaimsPrincipalSelector.GetClaimsPrincipal(_container.Resolve <IClaimsIdentityProvider>());

                _studentRepo = _container.Resolve <IUpsertEntity <Student> >();
                _programRepo = _container.Resolve <IUpsertEntity <Program> >();
                _studentProgramAssociationRepo = _container.Resolve <IUpsertEntity <StudentProgramAssociation> >();

                _studentTitleIPartAProgramAssociationRepo =
                    _container.Resolve <IUpsertEntity <StudentTitleIPartAProgramAssociation> >();

                _upsertService = _container.Resolve <IUpsertEntity <ServiceDescriptor> >();

                InitializeEducationOrganizationIdsForTest();

                _studentUniqueId = Guid.NewGuid()
                                   .ToString("N");

                _serviceDescriptor = GetTestServiceDescriptor();
                _program1          = GetProgram1();
                _program2          = GetProgram2();
                _student           = GetStudent();

                InitializeTestData();
            }
コード例 #2
0
        public NHibernateRepository(
            ISessionFactory sessionFactory,
            IGetEntitiesByIds <TEntity> getEntitiesByIds,
            IGetEntitiesBySpecification <TEntity> getEntitiesBySpecification,
            IUpsertEntity <TEntity> upsertEntity,
            IDeleteEntityById <TEntity> deleteEntityById,
            IDeleteEntityByKey <TEntity> deleteEntityByKey)
        {
            _getEntitiesByIds           = getEntitiesByIds;
            _getEntitiesBySpecification = getEntitiesBySpecification;
            _upsertEntity      = upsertEntity;
            _deleteEntityById  = deleteEntityById;
            _deleteEntityByKey = deleteEntityByKey;

            SessionFactory = sessionFactory;
        }
コード例 #3
0
            protected override void Arrange()
            {
                RegisterDependencies();
                IDescriptorsCache cache = null;

                DescriptorsCache.GetCache = () => cache ??= _container.Resolve <IDescriptorsCache>();

                IPersonUniqueIdToUsiCache personUniqueIdToUsiCache = null;

                PersonUniqueIdToUsiCache.GetCache = ()
                                                    => personUniqueIdToUsiCache ??= _container.Resolve <IPersonUniqueIdToUsiCache>();

                var assembly = typeof(Program).GetTypeInfo().Assembly;

                XmlConfigurator.Configure(LogManager.GetRepository(assembly));

                ClaimsPrincipal.ClaimsPrincipalSelector =
                    () => EdFiClaimsPrincipalSelector.GetClaimsPrincipal(_container.Resolve <IClaimsIdentityProvider>());

                _studentRepo = _container.Resolve <IUpsertEntity <Student> >();
                _programRepo = _container.Resolve <IUpsertEntity <Program> >();
                _studentProgramAssociationRepo = _container.Resolve <IUpsertEntity <StudentProgramAssociation> >();

                _studentTitleIPartAProgramAssociationRepo =
                    _container.Resolve <IUpsertEntity <StudentTitleIPartAProgramAssociation> >();

                _upsertService = _container.Resolve <IUpsertEntity <ServiceDescriptor> >();

                InitializeEducationOrganizationIdsForTest();

                _studentUniqueId = Guid.NewGuid()
                                   .ToString("N");

                _serviceDescriptor = GetTestServiceDescriptor();
                _program1          = GetProgram1();
                _program2          = GetProgram2();
                _student           = GetStudent();

                InitializeTestData();
            }
コード例 #4
0
 public PersistEntityModel(IUpsertEntity <TEntityModel> upsertEntity, IETagProvider etagProvider)
 {
     _upsertEntity = upsertEntity;
     _etagProvider = etagProvider;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpsertEntityAuthorizationDecorator{T}"/> class.
 /// </summary>
 /// <param name="next">The decorated instance for which authorization is being performed.</param>
 public UpsertEntityAuthorizationDecorator(IUpsertEntity <T> next)
 {
     _next = next;
 }