Esempio n. 1
0
        public SqlCommand Command(string CommandText)
        {
            SqlConnection connection = new SqlConnection(SqlConnectionString.ConnectionString());
            SqlCommand    command    = new SqlCommand();

            command.CommandText = CommandText;
            command.CommandType = CommandType.StoredProcedure;
            command.Connection  = connection;

            return(command);
        }
Esempio n. 2
0
        public IEnumerable <Products> FindProductsByCategoryID(int CategoryID)
        {
            IDbConnection connection = new SqlConnection(SqlConnectionString.ConnectionString());

            return(connection.Query <Products>("dbo.FindProductsByCategoryID", new { @CategoryID = CategoryID }, commandType: CommandType.StoredProcedure));
        }