Skip to content

Commit ce26de8

Browse files
authored
Update README.md
1 parent 4fd637e commit ce26de8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ We'll use the following two classes for our examples
3838
}
3939
```
4040

41-
## Convert to Table Entity
41+
## Convert To Table Entity
4242
Converting to a table entity is easy. Use the ``.ToTableEntity()`` extension method and specify which properties represent the partition key and row key. If you need to customize how any of those two keys serialize there are overloads that accept string values.
4343

4444
Example:
@@ -76,7 +76,16 @@ Below is an example that uses string keys instead:
7676
};
7777
var tableEntity = emp.ToTableEntity("Google", "42");
7878
```
79-
## Convert from Table Entity
79+
### Ignoring Properties When Converting To Table Entity
80+
When converting your POCO to a table entity and ultimately serializing and persisting to Azure Table Storage, you may want to ignore some fields. To ignore properties, use the optional ```ignoredProperties``` parameter.
81+
82+
Example:
83+
```csharp
84+
var tableEntity = emp.ToTableEntity(e=>e.Company, e=>e.Id, e=>e.ExternalId, e=>e.HireDate);
85+
```
86+
In the above example the partition key is ```Company```, the row key is ```Id``` and we ignored ```ExternalId``` and ```HireDate```.
87+
88+
## Convert From Table Entity
8089
Converting from a table entity is just as simple. If the both the partition keys can be converted to simple types, you can use the shorter overloaded extension method (```FromTableEntity```).
8190

8291
Here is a simple example where we specify the partition key (```Company```) and the row key (```Id```):

0 commit comments

Comments
 (0)