예제 #1
0
 public TesteBase(ITestOutputHelper saida)
 {
     this.Console = saida;
     ContainerDI.Inicializar();
     //ConfiguracaoRecursos.AdicionarRecurso(typeof(Properties.Resources));
     //Configuracao.DisplayNameExtrator = () => new DisplayNameExtratorPadrao();
 }
예제 #2
0
        public static void Main(string[] args)
        {
            var container = new ContainerDI(false);

            container.Registrar <IUnidadeTrabalho, UnityOfWorkFlashCard>(EscopoComponente.WebRequest);
            container.Registrar <TextFileToFlashCards, TextFileToFlashCards>();
            container.Registrar <ICollectionFlashCardService, CollectionFlashCardService>();
            container.FinalizarRegistros();

            try
            {
                var importer = container.GetService <TextFileToFlashCards>();
                importer.ProcessFolder(@"C:\tmp\LivrosEmTexto");
                Console.WriteLine("Acabou");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Erro: {ex.Message}");
            }
            _ = Console.ReadLine();
        }
예제 #3
0
        /// <summary>
        /// Gets the database manager to execute T-SQL statements against it
        /// </summary>
        /// <returns></returns>
        protected void SetContainer(DatabaseServers dBServer = DatabaseServers.DB_DEMO)
        {
            var configurationName = this.Configuration["ENVIRONMENT"];

            var keyName           = $"{configurationName}:{dBServer.ToString()}";
            var connection        = this.Configuration[keyName];
            var commandTimeout    = this.Configuration["FRAMEWORK.COMMAND.TIMEOUT"].ToInt();
            var connectionTimeout = this.Configuration["FRAMEWORK.CONNECTION.TIMEOUT"].ToInt();
            var traceEnabled      = this.Configuration["FRAMEWORK.TRACE.ENABLED"].ToBool();
            var traceFilePath     = this.Configuration["FRAMEWORK.TRACE.PATH"];

            if (!traceEnabled)
            {
                traceFilePath = string.Empty;
            }

            connection = Cryptography.DecryptUsingTripleDES(connection);

            var databaseContext    = new SQLDatabaseContext(connection, commandTimeout, connectionTimeout);
            var databaseRepository = new SQLDatabaseRepository(false, traceFilePath);

            container = new ContainerDI(databaseContext, databaseRepository);
        }
예제 #4
0
 public UserBLL(ContainerDI container) : base(container)
 {
 }
예제 #5
0
 public ClientBLL(ContainerDI container) : base(container)
 {
 }