mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 21:12:50 +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).
|
You can find an example project incorporating most Sieve concepts in [SieveTests](https://github.com/Biarity/Sieve/tree/master/SieveTests).
|
||||||
|
|
||||||
## Fluent API
|
## 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#
|
```C#
|
||||||
public class ApplicationSieveProcessor : SieveProcessor
|
public class ApplicationSieveProcessor : SieveProcessor
|
||||||
@ -278,7 +278,7 @@ To enable functional grouping of mappings the `ISieveConfiguration` interface wa
|
|||||||
```C#
|
```C#
|
||||||
public class SieveConfigurationForPost : ISieveConfiguration
|
public class SieveConfigurationForPost : ISieveConfiguration
|
||||||
{
|
{
|
||||||
protected override SievePropertyMapper Configure(SievePropertyMapper mapper)
|
public void Configure(SievePropertyMapper mapper)
|
||||||
{
|
{
|
||||||
mapper.Property<Post>(p => p.Title)
|
mapper.Property<Post>(p => p.Title)
|
||||||
.CanFilter()
|
.CanFilter()
|
||||||
@ -330,7 +330,7 @@ public class ApplicationSieveProcessor : SieveProcessor
|
|||||||
|
|
||||||
protected override SievePropertyMapper MapProperties(SievePropertyMapper mapper)
|
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