Query the departments for a product

To query the departments for a product, you must perform the following:

  1. Get instances of the following managers.
    • Catalog manager
    • Taxonomy manager
  2. Get an instance of the product.
    For more information, see For developers: Query products.
  3. Get the IDs of the departments.
    To get the IDs of the departments that the product belongs to, you must use the GetValue extension method of the product instance and get the Department value. It is of type TrackedList<Guid> and contains the ID of the departments.

    NOTE: To use the GetValue method, you must add a using for the Telerik.Sitefinity.Model namespace.

  4. Get the departments of the product.
    To get the departments of the product, get all taxa and filter the collection by the IDs of the departments of the product.

Code example: Query the departments of a product

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?