Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     //QuerySql.init();
     InsertSql.init();
     //   UpdateSql.init();
     //  DeleteSql.init();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Handles this instance.
        /// </summary>
        public Result Handle(Input input)
        {
            var Result    = new Result();
            var tableName = input.TableName;

            if (tableName.IsNullOrEmpty())
            {
                Result.ErrorMessage = "Herhangi bir tablo ismi seçilmelidir";
                return(Result);
            }

            var connectionInfo = FindProcedureContainerDatabaseConnectionInfo(input.TableName);

            if (connectionInfo == null)
            {
                return(Result);
            }

            var info = DbItemNameInfoParser.Parse(tableName);

            var writerContext = new WriterContext
            {
                Config = new TableConfig
                {
                    TableName        = info.Name,
                    SchemaName       = info.SchemaName,
                    DatabaseName     = info.DatabaseName ?? DatabaseNames.BOA,
                    DatabaseEnumName = connectionInfo.DatabaseName,
                    ServerNameForTakeTableInformation = ServerNames.GetServerNameOfConnectionString(connectionInfo.ConnectionStringDev)
                }
            };

            new NamingConvention {
                Context = writerContext
            }.InitializeNames();

            var generator = new InsertSql(writerContext);

            Result.GeneratedSQLCode = generator.Generate();

            return(Result);
        }