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
where it obviously make sense. I still don't want to break API naming, to simplify life of people. Once it's done, I will provide compatibility package which should be addon to MagicMapper
Starting with version 9.0, you can find out [what changed](https://raw.githubusercontent.com/AutoMapper/AutoMapper/master/src/AutoMapper/ApiCompatBaseline.txt) in the public API from the last major version release.
4
-
From the [releases page](https://github.com/AutoMapper/AutoMapper/releases) you can reach the source code for that release and the version of ApiCompatBaseline.txt in that tree will tell you what changed.
3
+
Starting with version 9.0, you can find out [what changed](https://raw.githubusercontent.com/NET-Sorcery/MagicMapper/master/src/AutoMapper/ApiCompatBaseline.txt) in the public API from the last major version release.
4
+
From the [releases page](https://github.com/NET-Sorcery/MagicMapper/releases) you can reach the source code for that release and the version of ApiCompatBaseline.txt in that tree will tell you what changed.
5
5
A major version release is compared with the previous major version release (so 9.0.0 with 8.0.0) and a minor version release with the current major version release (so 9.1.1 with 9.0.0).
Copy file name to clipboardExpand all lines: docs/source/Before-and-after-map-actions.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
# Before and After Map Action
2
2
3
-
Occasionally, you might need to perform custom logic before or after a map occurs. These should be a rarity, as it's more obvious to do this work outside of AutoMapper. You can create global before/after map actions:
3
+
Occasionally, you might need to perform custom logic before or after a map occurs. These should be a rarity, as it's more obvious to do this work outside of MagicMapper. You can create global before/after map actions:
Copy file name to clipboardExpand all lines: docs/source/Configuration-validation.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,8 +1,8 @@
1
1
# Configuration Validation
2
2
3
-
Hand-rolled mapping code, though tedious, has the advantage of being testable. One of the inspirations behind AutoMapper was to eliminate not just the custom mapping code, but eliminate the need for manual testing. Because the mapping from source to destination is convention-based, you will still need to test your configuration.
3
+
Hand-rolled mapping code, though tedious, has the advantage of being testable. One of the inspirations behind MagicMapper was to eliminate not just the custom mapping code, but eliminate the need for manual testing. Because the mapping from source to destination is convention-based, you will still need to test your configuration.
4
4
5
-
AutoMapper provides configuration testing in the form of the AssertConfigurationIsValid method. Suppose we have slightly misconfigured our source and destination types:
5
+
MagicMapper provides configuration testing in the form of the AssertConfigurationIsValid method. Suppose we have slightly misconfigured our source and destination types:
6
6
```c#
7
7
publicclassSource
8
8
{
@@ -41,7 +41,7 @@ var configuration = new MapperConfiguration(cfg =>
41
41
42
42
## Selecting members to validate
43
43
44
-
By default, AutoMapper uses the destination type to validate members. It assumes that all destination members need to be mapped. To modify this behavior, use the `CreateMap` overload to specify which member list to validate against:
44
+
By default, MagicMapper uses the destination type to validate members. It assumes that all destination members need to be mapped. To modify this behavior, use the `CreateMap` overload to specify which member list to validate against:
45
45
46
46
```c#
47
47
varconfiguration=newMapperConfiguration(cfg=>
@@ -55,4 +55,4 @@ To skip validation altogether for this map, use `MemberList.None`. That's the de
55
55
56
56
## Custom validations
57
57
58
-
You can add custom validations through an extension point. See [here](https://github.com/AutoMapper/AutoMapper/blob/master/src/UnitTests/CustomValidations.cs).
58
+
You can add custom validations through an extension point. See [here](https://github.com/NET-Sorcery/MagicMapper/blob/master/src/UnitTests/CustomValidations.cs).
Copy file name to clipboardExpand all lines: docs/source/Configuration.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ var configuration = new MapperConfiguration(cfg =>
85
85
);
86
86
```
87
87
88
-
AutoMapper will scan the designated assemblies for classes inheriting from Profile and add them to the configuration.
88
+
MagicMapper will scan the designated assemblies for classes inheriting from Profile and add them to the configuration.
89
89
90
90
## Naming Conventions
91
91
@@ -166,7 +166,7 @@ var configuration = new MapperConfiguration(cfg => {
166
166
configuration.AssertConfigurationIsValid();
167
167
```
168
168
169
-
By default AutoMapper recognizes the prefix "Get", if you need to clear the prefix:
169
+
By default MagicMapper recognizes the prefix "Get", if you need to clear the prefix:
170
170
171
171
```c#
172
172
varconfiguration=newMapperConfiguration(cfg=> {
@@ -177,7 +177,7 @@ var configuration = new MapperConfiguration(cfg => {
177
177
178
178
## Global property/field filtering
179
179
180
-
By default, AutoMapper tries to map every public property/field. You can filter out properties/fields with the property/field filters:
180
+
By default, MagicMapper tries to map every public property/field. You can filter out properties/fields with the property/field filters:
181
181
182
182
```c#
183
183
varconfiguration=newMapperConfiguration(cfg=>
@@ -193,7 +193,7 @@ var configuration = new MapperConfiguration(cfg =>
193
193
194
194
## Configuring visibility
195
195
196
-
By default, AutoMapper only recognizes public members. It can map to private setters, but will skip internal/private methods and properties if the entire property is private/internal. To instruct AutoMapper to recognize members with other visibilities, override the default filters ShouldMapField and/or ShouldMapProperty :
196
+
By default, MagicMapper only recognizes public members. It can map to private setters, but will skip internal/private methods and properties if the entire property is private/internal. To instruct MagicMapper to recognize members with other visibilities, override the default filters ShouldMapField and/or ShouldMapProperty :
197
197
198
198
```c#
199
199
varconfiguration=newMapperConfiguration(cfg=>
@@ -208,7 +208,7 @@ Map configurations will now recognize internal/private members.
208
208
209
209
## Configuration compilation
210
210
211
-
Because expression compilation can be a bit resource intensive, AutoMapper lazily compiles the type map plans on first map. However, this behavior is not always desirable, so you can tell AutoMapper to compile its mappings directly:
211
+
Because expression compilation can be a bit resource intensive, MagicMapper lazily compiles the type map plans on first map. However, this behavior is not always desirable, so you can tell MagicMapper to compile its mappings directly:
Copy file name to clipboardExpand all lines: docs/source/Custom-type-converters.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ public class Destination
24
24
}
25
25
```
26
26
27
-
If we were to try and map these two types as-is, AutoMapper would throw an exception (at map time and configuration-checking time), as AutoMapper does not know about any mapping from string to int, DateTime or Type. To create maps for these types, we must supply a custom type converter, and we have three ways of doing so:
27
+
If we were to try and map these two types as-is, MagicMapper would throw an exception (at map time and configuration-checking time), as MagicMapper does not know about any mapping from string to int, DateTime or Type. To create maps for these types, we must supply a custom type converter, and we have three ways of doing so:
@@ -41,7 +41,7 @@ public interface ITypeConverter<in TSource, TDestination>
41
41
}
42
42
```
43
43
44
-
And supply AutoMapper with either an instance of a custom type converter, or simply the type, which AutoMapper will instantiate at run time. The mapping configuration for our above source/destination types then becomes:
44
+
And supply MagicMapper with either an instance of a custom type converter, or simply the type, which MagicMapper will instantiate at run time. The mapping configuration for our above source/destination types then becomes:
Copy file name to clipboardExpand all lines: docs/source/Custom-value-resolvers.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Custom Value Resolvers
2
2
3
-
Although AutoMapper covers quite a few destination member mapping scenarios, there are the 1 to 5% of destination values that need a little help in resolving. Many times, this custom value resolution logic is domain logic that can go straight on our domain. However, if this logic pertains only to the mapping operation, it would clutter our source types with unnecessary behavior. In these cases, AutoMapper allows for configuring custom value resolvers for destination members. For example, we might want to have a calculated value just during mapping:
3
+
Although MagicMapper covers quite a few destination member mapping scenarios, there are the 1 to 5% of destination values that need a little help in resolving. Many times, this custom value resolution logic is domain logic that can go straight on our domain. However, if this logic pertains only to the mapping operation, it would clutter our source types with unnecessary behavior. In these cases, MagicMapper allows for configuring custom value resolvers for destination members. For example, we might want to have a calculated value just during mapping:
4
4
5
5
```c#
6
6
publicclassSource
@@ -36,13 +36,13 @@ public class CustomResolver : IValueResolver<Source, Destination, int>
36
36
}
37
37
```
38
38
39
-
Once we have our IValueResolver implementation, we'll need to tell AutoMapper to use this custom value resolver when resolving a specific destination member. We have several options in telling AutoMapper a custom value resolver to use, including:
39
+
Once we have our IValueResolver implementation, we'll need to tell MagicMapper to use this custom value resolver when resolving a specific destination member. We have several options in telling MagicMapper a custom value resolver to use, including:
40
40
41
41
* MapFrom\<TValueResolver\>
42
42
* MapFrom(typeof(CustomValueResolver))
43
43
* MapFrom(aValueResolverInstance)
44
44
45
-
In the below example, we'll use the first option, telling AutoMapper the custom resolver type through generics:
45
+
In the below example, we'll use the first option, telling MagicMapper the custom resolver type through generics:
46
46
47
47
```c#
48
48
varconfiguration=newMapperConfiguration(cfg=>
@@ -75,9 +75,9 @@ public class MultBy2Resolver : IValueResolver<object, object, int> {
75
75
76
76
### Custom constructor methods
77
77
78
-
Because we only supplied the type of the custom resolver to AutoMapper, the mapping engine will use reflection to create an instance of the value resolver.
78
+
Because we only supplied the type of the custom resolver to MagicMapper, the mapping engine will use reflection to create an instance of the value resolver.
79
79
80
-
If we don't want AutoMapper to use reflection to create the instance, we can supply it directly:
80
+
If we don't want MagicMapper to use reflection to create the instance, we can supply it directly:
@@ -86,15 +86,15 @@ var configuration = new MapperConfiguration(cfg => cfg.CreateMap<Source, Destina
86
86
));
87
87
```
88
88
89
-
AutoMapper will use that specific object, helpful in scenarios where the resolver might have constructor arguments or need to be constructed by an IoC container.
89
+
MagicMapper will use that specific object, helpful in scenarios where the resolver might have constructor arguments or need to be constructed by an IoC container.
90
90
91
91
### The resolved value is mapped to the destination property
92
92
93
93
Note that the value you return from your resolver is not simply assigned to the destination property. Any map that applies will be used and the result of that mapping will be the final destination property value. Check [the execution plan](Understanding-your-mapping.html).
94
94
95
95
### Customizing the source value supplied to the resolver
96
96
97
-
By default, AutoMapper passes the source object to the resolver. This limits the reusability of resolvers, since the resolver is coupled to the source type. If, however, we supply a common resolver across multiple types, we configure AutoMapper to redirect the source value supplied to the resolver, and also use a different resolver interface so that our resolver can get use of the source/destination members:
97
+
By default, MagicMapper passes the source object to the resolver. This limits the reusability of resolvers, since the resolver is coupled to the source type. If, however, we supply a common resolver across multiple types, we configure MagicMapper to redirect the source value supplied to the resolver, and also use a different resolver interface so that our resolver can get use of the source/destination members:
98
98
99
99
```c#
100
100
varconfiguration=newMapperConfiguration(cfg=> {
@@ -131,11 +131,11 @@ Starting with version 13.0, you can use `context.State` instead, in a similar wa
131
131
132
132
### ForPath
133
133
134
-
Similar to ForMember, from 6.1.0 there is ForPath. Check out [the tests](https://github.com/AutoMapper/AutoMapper/search?utf8=%E2%9C%93&q=ForPath&type=) for examples.
134
+
Similar to ForMember, from 6.1.0 there is ForPath. Check out [the tests](https://github.com/NET-Sorcery/MagicMapper/search?utf8=%E2%9C%93&q=ForPath&type=) for examples.
135
135
136
136
### Resolvers and conditions
137
137
138
-
For each property mapping, AutoMapper attempts to resolve the destination value **before** evaluating the condition. So it needs to be able to do that without throwing an exception even if the condition will prevent the resulting value from being used.
138
+
For each property mapping, MagicMapper attempts to resolve the destination value **before** evaluating the condition. So it needs to be able to do that without throwing an exception even if the condition will prevent the resulting value from being used.
139
139
140
140
As an example, here's sample output from [BuildExecutionPlan](Understanding-your-mapping.html) (displayed using [ReadableExpressions](https://marketplace.visualstudio.com/items?itemName=vs-publisher-1232914.ReadableExpressionsVisualizers)) for a single property:
Copy file name to clipboardExpand all lines: docs/source/Dependency-injection.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
@@ -4,7 +4,7 @@
4
4
5
5
### ASP.NET Core
6
6
7
-
There is a [NuGet package](https://www.nuget.org/packages/AutoMapper.Extensions.Microsoft.DependencyInjection/) to be used with the default injection mechanism described [here](https://github.com/AutoMapper/AutoMapper.Extensions.Microsoft.DependencyInjection) and used in [this project](https://github.com/jbogard/ContosoUniversityCore/blob/master/src/ContosoUniversityCore/Startup.cs).
7
+
There is a [NuGet package](https://www.nuget.org/packages/AutoMapper.Extensions.Microsoft.DependencyInjection/) to be used with the default injection mechanism described [here](https://github.com/NET-Sorcery/MagicMapper.Extensions.Microsoft.DependencyInjection) and used in [this project](https://github.com/jbogard/ContosoUniversityCore/blob/master/src/ContosoUniversityCore/Startup.cs).
8
8
9
9
Starting with version 13.0, `AddAutoMapper` is part of the core package and the DI package is discontinued.
### [Other DI engines](https://github.com/AutoMapper/AutoMapper/wiki/DI-examples)
35
+
### [Other DI engines](https://github.com/NET-Sorcery/MagicMapper/wiki/DI-examples)
36
36
37
37
## Low level API-s
38
38
39
-
AutoMapper supports the ability to construct [Custom Value Resolvers](Custom-value-resolvers.html), [Custom Type Converters](Custom-type-converters.html), and [Value Converters](Value-converters.html) using static service location:
39
+
MagicMapper supports the ability to construct [Custom Value Resolvers](Custom-value-resolvers.html), [Custom Type Converters](Custom-type-converters.html), and [Value Converters](Value-converters.html) using static service location:
0 commit comments