Skip to content

Commit b2755d7

Browse files
committed
Better docs readme
1 parent a8c14fd commit b2755d7

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

docs/README.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,3 @@ Welcome to the Facet documentation! This index will help you navigate all availa
1818
- [Facet.Mapping Reference](../src/Facet.Mapping/README.md): Complete Facet.Mapping Documentation
1919
- [Facet.Mapping.Expressions Reference](../src/Facet.Mapping.Expressions/README.md): Complete Expression Mapping Documentation
2020

21-
## Quick Reference
22-
23-
### Basic Usage
24-
```csharp
25-
[Facet(typeof(User))]
26-
public partial class UserDto { }
27-
28-
var userDto = user.ToFacet<UserDto>();
29-
```
30-
31-
### Custom Sync Mapping
32-
```csharp
33-
public class UserMapper : IFacetMapConfiguration<User, UserDto>
34-
{
35-
public static void Map(User source, UserDto target)
36-
{
37-
target.FullName = $"{source.FirstName} {source.LastName}";
38-
}
39-
}
40-
```
41-
42-
### Async Mapping
43-
```csharp
44-
public class UserAsyncMapper : IFacetMapConfigurationAsync<User, UserDto>
45-
{
46-
public static async Task MapAsync(User source, UserDto target, CancellationToken cancellationToken = default)
47-
{
48-
target.ProfilePicture = await GetProfilePictureAsync(source.Id, cancellationToken);
49-
}
50-
}
51-
52-
var userDto = await user.ToFacetAsync<UserDto, UserAsyncMapper>();
53-
```
54-
55-
### Expression Mapping
56-
```csharp
57-
// Define business logic once for entities
58-
Expression<Func<User, bool>> activeUsers = u => u.IsActive && !u.IsDeleted;
59-
60-
// Transform to work with DTOs
61-
Expression<Func<UserDto, bool>> activeDtoUsers = activeUsers.MapToFacet<UserDto>();
62-
63-
// Use with collections
64-
var filteredDtos = dtoCollection.Where(activeDtoUsers.Compile()).ToList();
65-
```

0 commit comments

Comments
 (0)