mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 13:02:46 +01:00
parent
863d75bdc1
commit
7aaadccf18
@ -231,7 +231,7 @@ It is recommended that you write exception-handling middleware to globally handl
|
||||
You can find an example project incorporating most Sieve concepts in [SieveTests](https://github.com/Biarity/Sieve/tree/master/SieveTests).
|
||||
|
||||
## Fluent API
|
||||
To use the Fluent API instead of attributes in marking properties, setup an alternative `SieveProcessor` that overrides `MapProperties`. For example:
|
||||
To use the Fluent API instead of attributes in marking properties, setup an alternative `SieveProcessor` that overrides `MapProperties`. For [example](https://github.com/Biarity/Sieve/blob/master/Sieve.Sample/Services/ApplicationSieveProcessor.cs):
|
||||
|
||||
```C#
|
||||
public class ApplicationSieveProcessor : SieveProcessor
|
||||
@ -278,7 +278,7 @@ To enable functional grouping of mappings the `ISieveConfiguration` interface wa
|
||||
```C#
|
||||
public class SieveConfigurationForPost : ISieveConfiguration
|
||||
{
|
||||
protected override SievePropertyMapper Configure(SievePropertyMapper mapper)
|
||||
public void Configure(SievePropertyMapper mapper)
|
||||
{
|
||||
mapper.Property<Post>(p => p.Title)
|
||||
.CanFilter()
|
||||
@ -330,7 +330,7 @@ public class ApplicationSieveProcessor : SieveProcessor
|
||||
|
||||
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
|
||||
{
|
||||
return mapper.ApplyConfigurationForAssembly(typeof(ApplicationSieveProcessor).Assembly);
|
||||
return mapper.ApplyConfigurationsFromAssembly(typeof(ApplicationSieveProcessor).Assembly);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user