Exemplo n.º 1
0
 public CodeGenerator(
     IEntityGenerator entityGenerator,
     IServiceGenerator serviceGenerator,
     IViewGenerator viewGenerator,
     IControllerGenerator controllerGenerator)
 {
     _entityGenerator     = entityGenerator;
     _serviceGenerator    = serviceGenerator;
     _viewGenerator       = viewGenerator;
     _controllerGenerator = controllerGenerator;
 }
Exemplo n.º 2
0
 public EntitiesCodeGenerator(
     IEntityGenerator entityGenerator,
     IServiceGenerator serviceGenerator,
     IViewGenerator viewGenerator,
     IControllerGenerator controllerGenerator,
     BaseGeneratorDatabaseCreator databaseGenerator) : base(databaseGenerator)
 {
     _entityGenerator     = entityGenerator;
     _serviceGenerator    = serviceGenerator;
     _viewGenerator       = viewGenerator;
     _controllerGenerator = controllerGenerator;
 }
Exemplo n.º 3
0
        public static void PerformRepositoryGenerate(TargetLanguage targetLanguage, TargetDatabaseConnector targetDatabaseConnector, string connectionString, string directory, string @namespace)
        {
            IServiceGenerator strategy = default;
            var generator = new UnitOfWorkGenerator();

            switch (targetLanguage)
            {
            case TargetLanguage.CSharp:
                strategy = new CSharpStrategy(connectionString, directory, @namespace);
                break;

            case TargetLanguage.VisualBasic:
                strategy = new VisualBasicStrategy(connectionString, directory, @namespace);
                break;

            case TargetLanguage.TypeScript:
                strategy = new TypeScriptStrategy(connectionString, directory, @namespace);
                break;
            }
            switch (targetDatabaseConnector)
            {
            case TargetDatabaseConnector.SQLServer:
                strategy.SetGenerator <SqlConnection, SqlParameter>((x) => $"[{x}]");
                break;

            case TargetDatabaseConnector.Oracle:
                strategy.SetGenerator <OracleConnection, OracleParameter>();
                break;

            case TargetDatabaseConnector.MySQL:
                strategy.SetGenerator <MySqlConnection, MySqlParameter>();
                break;

            case TargetDatabaseConnector.PostgreSQL:
                strategy.SetGenerator <NpgsqlConnection, NpgsqlParameter>();
                break;

            case TargetDatabaseConnector.SQLite:
                strategy.SetGenerator <SQLiteConnection, SQLiteParameter>();
                break;
            }
            generator.UseStrategy(strategy);
            generator.Generate();
        }
 public void UseStrategy(IServiceGenerator strategy)
 {
     _strategy = strategy;
 }
 public UnitOfWorkGenerator(IServiceGenerator strategy)
 {
     UseStrategy(strategy);
 }
Exemplo n.º 6
0
 public ShapesController(IServiceGenerator service)
 {
     _service = service;
 }
 private static IServiceCollection AddFromServiceGenerator(this IServiceCollection services, IServiceGenerator generator)
 {
     return(generator.Generate(services));
 }
Exemplo n.º 8
0
 public ServicesGenerator(ITypeIsClassValidator typeIsClassValidator, IImplementationsFinder implementationsFinder, IServiceGenerator serviceGenerator)
 {
     TypeIsClassValidator  = typeIsClassValidator;
     ImplementationsFinder = implementationsFinder;
     ServiceGenerator      = serviceGenerator;
 }