public AttributeTypeCollection Read(EntityType entityType, IEntityTypeRepository entityTypeRepository) { var attributes = new AttributeTypeCollection(); using (SqlConnection sqlConnection = _connectionProvider.GetConnection()) { using (SqlCommand sqlCommand = sqlConnection.CreateCommand()) { sqlCommand.CommandText = string.Format( "SELECT * FROM hsck.EntityAttributeTypes WHERE ParentEntityTypeName='{0}'", entityType.Name); using (SqlDataReader reader = sqlCommand.ExecuteReader()) { while (reader.Read()) { var entityTypeName = (string) reader["ChildEntityTypeName"]; var attributeName = (string) reader["Name"]; EntityType ofType = entityTypeName == entityType.Name ? entityType : entityTypeRepository.Read(entityTypeName); var entityAttributeType = new EntityAttributeType { Id = (int) reader["Id"], Name = attributeName, OfType = ofType }; attributes.Add(entityAttributeType); } } } } return attributes; }
public ModelVerification(IEntityTypeRepository typeRepository, ITableFactory tableFactory, int tolerance) { _tolerance = tolerance; _tableFactory = tableFactory; NameSpacesToIgnore = Enumerable.Empty <string>(); _typeRepository = typeRepository; }
public AttributeTypeCollection Read(EntityType entityType, IEntityTypeRepository entityTypeRepository) { var attributes = new AttributeTypeCollection(); using (SqlConnection sqlConnection = _connectionProvider.GetConnection()) { using (SqlCommand sqlCommand = sqlConnection.CreateCommand()) { sqlCommand.CommandText = string.Format("SELECT * FROM hsck.AttributeTypes WHERE EntityTypeId='{0}'", entityType.Id); using (SqlDataReader reader = sqlCommand.ExecuteReader()) { while (reader.Read()) { var dataType = (DataType) Enum.Parse(typeof (DataType), (string) reader["DataType"]); var attributeType = new AttributeType { Id = (int) reader["Id"], Name = (string) reader["Name"], DataType = dataType }; attributes.Add(attributeType); } } } } attributes.Add(_entityAttributeTypeRepository.Read(entityType, entityTypeRepository)); return attributes; }
public AttributesController(IAttributeRepository attributeRepository, IEntityTypeRepository entityTypeRepository, IHubContext <SignalRServer> signalRHub) { _signalRHub = signalRHub; _attributeRepository = attributeRepository; _entityTypeRepository = entityTypeRepository; }
public EntityTypeBusinessEngine(IDataRepositoryFactory data_repo_fact, ICache cache, IEntityServiceFactory ent_serv_fact) : base(data_repo_fact, null, ent_serv_fact) { _cache = cache; _repo_ent_type = _data_repository_factory.GetDataRepository <IEntityTypeRepository>(); GetTypes(); }
protected override void Dispose(bool disposing) { if (disposing) { if (contractorRepository != null) { contractorRepository.Dispose(); contractorRepository = null; } if (contractRepository != null) { contractRepository.Dispose(); contractRepository = null; } if (periodRepository != null) { periodRepository.Dispose(); periodRepository = null; } if (requirementRepository != null) { requirementRepository.Dispose(); requirementRepository = null; } if (presentationRepository != null) { presentationRepository.Dispose(); presentationRepository = null; } if (presentationServices != null) { presentationServices.Dispose(); presentationServices = null; } //documentFileService.Dispose(); if (workflowMessageService != null) { workflowMessageService.Dispose(); workflowMessageService = null; } if (entityTypeRepository != null) { entityTypeRepository.Dispose(); entityTypeRepository = null; } } base.Dispose(disposing); }
/// <summary> /// Create a new <see cref="SystemEntityAccessControlChecker" />. /// </summary> /// <param name="roleRepository"> /// Used to load roles for a given user. This cannot be null. /// </param> /// <param name="queryRepository"> /// Used to load queries for a role and permission. This cannot be null. /// </param> /// <param name="entityTypeRepository"> /// Used to load the types of each entity. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// No argument can be null. /// </exception> internal SystemEntityAccessControlChecker(IUserRoleRepository roleRepository, IQueryRepository queryRepository, IEntityTypeRepository entityTypeRepository) : base(roleRepository, queryRepository, entityTypeRepository) { if (roleRepository == null) { throw new ArgumentNullException(nameof(roleRepository)); } if (queryRepository == null) { throw new ArgumentNullException(nameof(queryRepository)); } if (entityTypeRepository == null) { throw new ArgumentNullException(nameof(entityTypeRepository)); } }
protected override void Dispose(bool disposing) { if (disposing) { if (documentationRepository != null) { documentationRepository.Dispose(); documentationRepository = null; } if (entityTypeRepository != null) { entityTypeRepository.Dispose(); entityTypeRepository = null; } } base.Dispose(disposing); }
/// <summary> /// Create a new <see cref="EntityAccessControlChecker"/>. /// </summary> /// <param name="roleRepository"> /// Used to load roles for a given user. This cannot be null. /// </param> /// <param name="queryRepository"> /// Used to load queries for a role and permission. This cannot be null. /// </param> /// <param name="entityTypeRepository"> /// Used to load the types of each entity. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// No argument can be null. /// </exception> internal EntityAccessControlChecker(IUserRoleRepository roleRepository, IQueryRepository queryRepository, IEntityTypeRepository entityTypeRepository) { if (roleRepository == null) { throw new ArgumentNullException("roleRepository"); } if (queryRepository == null) { throw new ArgumentNullException("queryRepository"); } if (entityTypeRepository == null) { throw new ArgumentNullException("entityTypeRepository"); } RoleRepository = roleRepository; QueryRepository = queryRepository; EntityTypeRepository = entityTypeRepository; }
public ContractorRequirementsController(IContractorRepository contractorRepo, IContractRepository contractRepo, IPeriodRepository periodRepo, IRequirementRepository requirementRepo, IPresentationRepository presentationRepo, IPresentationServices presentationServ, IDocumentFileService documentFileServ, IWorkflowMessageService workflowMessageServ, IEntityTypeRepository entityTypeRepo) { contractorRepository = contractorRepo; contractRepository = contractRepo; periodRepository = periodRepo; requirementRepository = requirementRepo; presentationRepository = presentationRepo; presentationServices = presentationServ; documentFileService = documentFileServ; workflowMessageService = workflowMessageServ; entityTypeRepository = entityTypeRepo; }
/// <summary> /// Create a new <see cref="SecuresFlagEntityAccessControlChecker"/> using /// the given <paramref name="checker"/>. /// </summary> /// <param name="checker"> /// The <see cref="IEntityAccessControlChecker"/> that checks access /// to specific entities. This cannot be null. /// </param> /// <param name="entityMemberRequestFactory"> /// The <see cref="IEntityMemberRequestFactory"/> that generates entity member requests /// to determine which related entities to check security on. This cannot be null. /// </param> /// <param name="typeRepository"> /// A <see cref="IEntityTypeRepository"/>. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// No argument can be null. /// </exception> internal SecuresFlagEntityAccessControlChecker(IEntityAccessControlChecker checker, IEntityMemberRequestFactory entityMemberRequestFactory, IEntityTypeRepository typeRepository) { if (checker == null) { throw new ArgumentNullException(nameof(checker)); } if (typeRepository == null) { throw new ArgumentNullException(nameof(typeRepository)); } if (entityMemberRequestFactory == null) { throw new ArgumentNullException(nameof(entityMemberRequestFactory)); } Checker = checker; TypeRepository = typeRepository; EntityMemberRequestFactory = entityMemberRequestFactory; }
public RequirementsController(IRequirementRepository requirementRepo, IPresentationRepository presentationRepo, IDocumentFileService documentFileServ, ICustomerAuditorRespository customerAuditorRespo, IContractorRepository contractorRepo, IPresentationServices presentationServ, IWorkflowMessageService workflowMessageServ, IDocumentationBusinessTypeRepository documentationBusinessTypeRepo, IPeriodRepository periodRepo, IEntityTypeRepository entityTypeRepo) { requirementRepository = requirementRepo; presentationRepository = presentationRepo; documentFileService = documentFileServ; customerAuditorRespository = customerAuditorRespo; contractorRepository = contractorRepo; presentationServices = presentationServ; workflowMessageService = workflowMessageServ; documentationBusinessTypeRepository = documentationBusinessTypeRepo; periodRepository = periodRepo; entityTypeRepository = entityTypeRepo; }
public UpdateEntityTypeCommandHandler(IEntityTypeRepository repository) { this.repository = repository; }
public GetEntityTypeQuery(IEntityTypeRepository repository) { this.repository = repository; }
public EntityTypesController(IEntityTypeRepository entityTypeRepository, IHubContext <SignalRServer> signalRHub) { _entityTypeRepository = entityTypeRepository; _signalRHub = signalRHub; }
public EntityTypeController(IEntityTypeRepository EntityTypeRepository) { _EntityTypeRepository = EntityTypeRepository; }
public CreateEntityCommandHandler(IEntityRepository repository, IEntityTypeRepository teRepository) { _entityRepository = repository; _teRepository = teRepository; }
public DocumentationsController(IDocumentationRepository documentationRepo, IEntityTypeRepository entityTypeRepo) { documentationRepository = documentationRepo; entityTypeRepository = entityTypeRepo; }
public Repository(IEntityTypeRepository entityTypeRepository, IEntityRepository entityRepository) { EntityTypes = entityTypeRepository; Entities = entityRepository; }
public HomeController(IEntityTypeRepository repos) { _repos = repos; }
public EntityTypeController(ApplicationDbContext context, IEntityTypeRepository repository) { _context = context; _repository = repository; }