Ejemplo n.º 1
0
        public static DbCommand Command(this DbConnection connection, string sql)
        {
            // TODO: get factory from DI container
            //var factory = PopForumsActivation.Container.GetInstance<ISqlObjectFactory>();
            //var command = factory.GetCommand(sql, connection);
            var command = new SqlObjectFactory().GetCommand(sql, connection);

            return(command);
        }
Ejemplo n.º 2
0
        public static DbCommand AddParameter(this DbCommand command, string parameterName, object value)
        {
            // TODO: get factory from DI container
            //var factory = PopForumsActivation.Container.GetInstance<ISqlObjectFactory>();
            //var parameter = factory.GetParameter(parameterName, value);
            var parameter = new SqlObjectFactory().GetParameter(parameterName, value);

            command.Parameters.Add(parameter);
            return(command);
        }