예제 #1
0
        public IDBTableAdapterCommand <T> CreateInsertCommand(DBTableAdapterContext <T> context)
        {
            var cmd = new ReturningCommand <T>(
                _SqlResolver.InsertTemplate(context),
                context.AllColumnsInfo.Select(i => new CommandParameter <T> {
                Column = i, Direction = ParameterDirection.InputOutput
            })
                );

            return(cmd);
        }
예제 #2
0
        public IDBTableAdapterCommand <T> CreateUpdateCommand(DBTableAdapterContext <T> context)
        {
            if (context.PkColumns.Count() == 0)
            {
                return(null);
            }
            var cmd = new ReturningCommand <T>(
                _SqlResolver.UpdateTemplate(context),
                context.AllColumnsInfo.Select(i => new CommandParameter <T> {
                Column = i, Direction = ParameterDirection.InputOutput
            })
                );

            return(cmd);
        }