Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string connectionString = null;
            string tableName        = null;

            string[] columnsName = null;

            var parser = new Fclp.FluentCommandLineParser();

            parser.Setup <string>("connectionString").Callback(x => connectionString = x);
            parser.Setup <string>("tableName").Callback(x => tableName     = x);
            parser.Setup <string>("columnsName").Callback(x => columnsName = x.Split(','));
            parser.Parse(args);

            Console.WriteLine("Connecting...");

            var parameters = new SqlSetParameters(connectionString, tableName, columnsName);
            var set        = new SqlSet(parameters);

            set.CreateObjects();

            set.AddIfNotExists(new[] { new ItemDto() });
            set.AddIfNotExists(new[] { new ItemDto()
                                       {
                                           Int = 2
                                       } });
        }