---
title: Include fields
slug: cms-12/docs/including-fields
docTags: 
createdAt: 2026-08-10T15:56:00.000Z
---

In some situations, especially when working with classes from third-party libraries, you can index values that are not exposed as objects' properties.

By customizing the `Client` conventions, you can *include*  just about any value indexed by including delegates with a return value when indexing. These delegates can use methods, extension methods, and operations on the properties exposed by the indexed object.

Given a `BlogPost` class with a list of tags, you can include the tag count by configuring the `Client` conventions to include an expression that retrieves it.

```csharp
//using EPiServer.Find.ClientConventions;
client.Conventions.ForInstancesOf<BlogPost>()
  .IncludeField(x => x.Tags.Count());
```

You can then search and filter for the indexed value:

```csharp
client.Search<BlogPost>()
  .Filter(x => x.Tags.Count().Match(firstIndexedObject.Tags.Count()))
  .GetResult();
```

You also can supply a delegate to set the value when returned in a search result.

```csharp
client.Conventions.ForInstancesOf<BlogPost>()
  .IncludeField(x => x.GetSomeField(), (x, value) => x.SetSomeField(value));
```
