Skip to content

Commit

Permalink
chore: modify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMakkison committed Oct 22, 2023
1 parent 23bb643 commit 8aab15d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions docs/docs/configuration/private-member-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ description: Private member mapping

# Private member mapping

Mention generating a static class of helper methods using this technique
As of .NET 8.0, Mapperly supports mapping members that are normally inaccessible like `private` or `protected` properties. This is made possible by using the [UnsafeAccessorAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.unsafeaccessorattribute) which lets Mapperly access normally inaccessible members with zero overhead while being completely AOT safe.

As of .Net 8.0, Mapperly supports mapping members that are normally inaccessible like `private` or `protected` properties. This is made possible by using the [UnsafeAccessorAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.unsafeaccessorattribute) which lets Mapperly access normally inaccessible members with zero overhead while being completely AOT safe.

By default `IncludedMembers` is set to `MemberVisibility.AllAccessible` which will configure Mapperly to map member of all accessibility levels as long as they are ordinarily accessible. To enable unsafe accessor usage, set `IncludedMembers` to `MemberVisibility.All`. Mapperly will then try to map members of all accessibilities, including ones that are not usually visible.

See example below
By default `IncludedMembers` is set to `MemberVisibility.AllAccessible` which will configure Mapperly to map members of all accessibility levels as long as they are ordinarily accessible. To enable unsafe accessor usage, set `IncludedMembers` to `MemberVisibility.All`. Mapperly will then try to map members of all accessibilities, including ones that are not usually visible to external types.

```csharp
public class Fruit
Expand Down

0 comments on commit 8aab15d

Please sign in to comment.