You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/Assembly-Scanning.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
By default, the assembly in which a base type is declared is searched for derived types. If there are additional assemblies which should be searched, use:
Copy file name to clipboardExpand all lines: docs/src/Collections.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Generic `List<T>` instances are created for interface-type members except `ISet<
23
23
24
24
By default, if the source collection matching a target collection is null, the target collection is populated with an empty collection. You can configure setting the target collection to null instead like this:
25
25
26
-
```C#
26
+
```cs
27
27
// Map null-source collections to null for all source
To apply all `MapperConfiguration` Types from the Assemblies current loaded into the `AppDomain`, use:
65
65
66
-
```C#
66
+
```cs
67
67
// Scan all Assemblies from the AppDomain:
68
68
Mapper.WhenMapping
69
69
.UseConfigurations.FromCurrentAppDomain();
@@ -79,7 +79,7 @@ Mapper.WhenMapping
79
79
80
80
Calling `GetPlansFor<Source>().To<Target>()` caches the mapping function at the point you call it. If Types configured in the object graph are configured in more than one `MapperConfiguration`, you might need to define an order in which configuration classes are applied. Use:
81
81
82
-
```C#
82
+
```cs
83
83
// Configure aspects of Parent -> Parent mapping, which includes
@@ -100,7 +100,7 @@ Chains of `ApplyAfter` attributes will be followed, with all configurations auto
100
100
101
101
[Configured Service Providers](Dependency-Injection) are available to `MapperConfiguration` classes. For example:
102
102
103
-
```C#
103
+
```cs
104
104
// Get a Dependency Injection container:
105
105
vardiContainer=GetDiContainer();
106
106
@@ -114,7 +114,7 @@ Mapper.WhenMapping
114
114
115
115
...the DI container and its registered services are now available to the `MapperConfiguration` class via the `GetService<TService>()` and `GetServiceProvider<TContainer>()` methods:
Copy file name to clipboardExpand all lines: docs/src/Configuring-Exception-Handling.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
By default, an `Exception` thrown during a mapping is wrapped in a [`MappingException`](/agileobjects/AgileMapper/blob/master/AgileMapper/MappingException.cs) and rethrown. To configure a mapper to swallow exceptions and return null instead, use:
2
2
3
-
```C#
3
+
```cs
4
4
Mapper.WhenMapping
5
5
.SwallowAllExceptions();
6
6
```
7
7
8
8
Alternatively, to have a mapper call a callback in the event of an exception use:
9
9
10
-
```C#
10
+
```cs
11
11
Mapper.WhenMapping
12
12
.PassExceptionsTo(ctx=>
13
13
{
@@ -23,7 +23,7 @@ Mapper.WhenMapping
23
23
24
24
To only swallow exceptions thrown when mapping particular types, use:
25
25
26
-
```C#
26
+
```cs
27
27
Mapper.WhenMapping
28
28
.From<PersonViewModel>() // Apply to PersonViewModel mappings (optional)
29
29
.To<Person>() // Apply to Person creation, updates and merges
@@ -32,7 +32,7 @@ Mapper.WhenMapping
32
32
33
33
...and to have a callback called for a particular type, use:
0 commit comments