Skip to content

Commit 497ce6c

Browse files
committed
Update namingfrom AutoMapper to MagicMapper
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
1 parent 407f63a commit 497ce6c

25 files changed

+90
-90
lines changed

docs/source/API-Changes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# API Changes
22

3-
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.
55
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).

docs/source/Before-and-after-map-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Before and After Map Action
22

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:
44

55
```c#
66
var configuration = new MapperConfiguration(cfg => {

docs/source/Conditional-mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Conditional Mapping
22

3-
AutoMapper allows you to add conditions to properties that must be met before that property will be mapped.
3+
MagicMapper allows you to add conditions to properties that must be met before that property will be mapped.
44

55
This can be used in situations like the following where we are trying to map from an int to an unsigned int.
66
```c#

docs/source/Configuration-validation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Configuration Validation
22

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.
44

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:
66
```c#
77
public class Source
88
{
@@ -41,7 +41,7 @@ var configuration = new MapperConfiguration(cfg =>
4141

4242
## Selecting members to validate
4343

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:
4545

4646
```c#
4747
var configuration = new MapperConfiguration(cfg =>
@@ -55,4 +55,4 @@ To skip validation altogether for this map, use `MemberList.None`. That's the de
5555

5656
## Custom validations
5757

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).

docs/source/Configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var configuration = new MapperConfiguration(cfg =>
8585
);
8686
```
8787

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.
8989

9090
## Naming Conventions
9191

@@ -166,7 +166,7 @@ var configuration = new MapperConfiguration(cfg => {
166166
configuration.AssertConfigurationIsValid();
167167
```
168168

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:
170170

171171
```c#
172172
var configuration = new MapperConfiguration(cfg => {
@@ -177,7 +177,7 @@ var configuration = new MapperConfiguration(cfg => {
177177

178178
## Global property/field filtering
179179

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:
181181

182182
```c#
183183
var configuration = new MapperConfiguration(cfg =>
@@ -193,7 +193,7 @@ var configuration = new MapperConfiguration(cfg =>
193193

194194
## Configuring visibility
195195

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 :
197197

198198
```c#
199199
var configuration = new MapperConfiguration(cfg =>
@@ -208,7 +208,7 @@ Map configurations will now recognize internal/private members.
208208

209209
## Configuration compilation
210210

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:
212212

213213
```c#
214214
var configuration = new MapperConfiguration(cfg => {});

docs/source/Construction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Construction
22

3-
AutoMapper can map to destination constructors based on source members:
3+
MagicMapper can map to destination constructors based on source members:
44

55
```c#
66
public class Source {

docs/source/Custom-type-converters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class Destination
2424
}
2525
```
2626

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:
2828

2929
```c#
3030
void ConvertUsing(Func<TSource, TDestination> mappingFunction);
@@ -41,7 +41,7 @@ public interface ITypeConverter<in TSource, TDestination>
4141
}
4242
```
4343

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:
4545

4646
```c#
4747
[Test]

docs/source/Custom-value-resolvers.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Custom Value Resolvers
22

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:
44

55
```c#
66
public class Source
@@ -36,13 +36,13 @@ public class CustomResolver : IValueResolver<Source, Destination, int>
3636
}
3737
```
3838

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:
4040

4141
* MapFrom\<TValueResolver\>
4242
* MapFrom(typeof(CustomValueResolver))
4343
* MapFrom(aValueResolverInstance)
4444

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:
4646

4747
```c#
4848
var configuration = new MapperConfiguration(cfg =>
@@ -75,9 +75,9 @@ public class MultBy2Resolver : IValueResolver<object, object, int> {
7575

7676
### Custom constructor methods
7777

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.
7979

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:
8181

8282
```c#
8383
var configuration = new MapperConfiguration(cfg => cfg.CreateMap<Source, Destination>()
@@ -86,15 +86,15 @@ var configuration = new MapperConfiguration(cfg => cfg.CreateMap<Source, Destina
8686
));
8787
```
8888

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.
9090

9191
### The resolved value is mapped to the destination property
9292

9393
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).
9494

9595
### Customizing the source value supplied to the resolver
9696

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:
9898

9999
```c#
100100
var configuration = new MapperConfiguration(cfg => {
@@ -131,11 +131,11 @@ Starting with version 13.0, you can use `context.State` instead, in a similar wa
131131

132132
### ForPath
133133

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.
135135

136136
### Resolvers and conditions
137137

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.
139139

140140
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:
141141

docs/source/Dependency-injection.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### ASP.NET Core
66

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).
88

99
Starting with version 13.0, `AddAutoMapper` is part of the core package and the DI package is discontinued.
1010

@@ -16,7 +16,7 @@ or marker types:
1616
```c#
1717
services.AddAutoMapper(typeof(ProfileTypeFromAssembly1), typeof(ProfileTypeFromAssembly2) /*, ...*/);
1818
```
19-
Now you can inject AutoMapper at runtime into your services/controllers:
19+
Now you can inject MagicMapper at runtime into your services/controllers:
2020
```c#
2121
public class EmployeesController {
2222
private readonly IMapper _mapper;
@@ -32,11 +32,11 @@ There is a third-party [NuGet package](https://www.nuget.org/packages/AutoMapper
3232

3333
Also, check [this blog](https://dotnetfalcon.com/autofac-support-for-automapper/).
3434

35-
### [Other DI engines](https://github.com/AutoMapper/AutoMapper/wiki/DI-examples)
35+
### [Other DI engines](https://github.com/NET-Sorcery/MagicMapper/wiki/DI-examples)
3636

3737
## Low level API-s
3838

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:
4040

4141
```c#
4242
var configuration = new MapperConfiguration(cfg =>

docs/source/Dynamic-and-ExpandoObject-Mapping.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Dynamic and ExpandoObject Mapping
22

3-
AutoMapper can map to/from dynamic objects without any explicit configuration:
3+
MagicMapper can map to/from dynamic objects without any explicit configuration:
44

55
```c#
66
public class Foo {
@@ -23,7 +23,7 @@ foo2.Bar.ShouldEqual(5);
2323
foo2.Baz.ShouldEqual(6);
2424
```
2525

26-
Similarly you can map straight from `Dictionary<string, object>` to objects, AutoMapper will line up the keys with property names.
26+
Similarly you can map straight from `Dictionary<string, object>` to objects, MagicMapper will line up the keys with property names.
2727
For mapping to destination child objects, you can use the dot notation.
2828
```c#
2929
var result = mapper.Map<Foo>(new Dictionary<string, object> { ["InnerFoo.Bar"] = 42 });

0 commit comments

Comments
 (0)