Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Update the readme to include a description of Selections and how to u…
Browse files Browse the repository at this point in the history
…se them
  • Loading branch information
Dominik Weber committed Dec 28, 2015
1 parent 5d77bcf commit f5f8c92
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ Property, array (per index) and dictionary (per key) resolution are supported ou
> NestedArray[2][1]
> NestedDictionary[Key1][Key2]
## Selections

Pather.CSharp can also operate on collections of objects. If you have an array of objects,
and each has a property called `P`, you can access it and get the values of `P` for all objects
in the array.
This behavior can be triggered using `[]` in the path on a `IEnumerable`.

For **example**:
```C#
var r = new Resolver();
var array = new[]
{
new { P1 = "1" },
new { P1 = "2" }
};
var path = "[].P1";

var result = r.Resolve(array, path);
//result is a collection that contains the values "1" and "2"
```

## Teaching Pather.CSharp new Tricks

#### Preamble
Expand Down

0 comments on commit f5f8c92

Please sign in to comment.