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); }
public IEnumerable <Products> FindProductsByCategoryID(int CategoryID) { IDbConnection connection = new SqlConnection(SqlConnectionString.ConnectionString()); return(connection.Query <Products>("dbo.FindProductsByCategoryID", new { @CategoryID = CategoryID }, commandType: CommandType.StoredProcedure)); }