-
Notifications
You must be signed in to change notification settings - Fork 36
create map for source member
The createMap.forSourceMember function specifies what action has to be performed when mapping a certain source member.
Ignore a source property
createMap.forSourceMember function sample to ignore a source property.
automapper
.createMap(fromKey, toKey)
.forSourceMember('prop', (opts: AutoMapperJs.ISourceMemberConfigurationOptions) => { opts.ignore(); });createMap.forSourceMember function sample to provide a custom value for a source property. Probably, this is not very useful; it should slow down the libray if we should try to prevent this functionality, so let's allow it for now - please inform us if you find business value in this functionality ;) ...
automapper
.createMap(fromKey, toKey)
.forSourceMember('prop1', (opts: AutoMapperJs.ISourceMemberConfigurationOptions) => { return 'Yeah!'; });AutoMapperTS is Copyright © 2015 Bert Loedeman and other contributors under the MIT license.
Getting started
Mapping performance
Initialization (initialize)
Mapping configuration (createMap)
- forMember
- forSourceMember
- condition
- forAllMembers
- ignoreAllNonExisting
- convertToType
- convertUsing
- withProfile
Validation (assertConfigurationIsValid)
Mapping (map)
Currying
Custom type converters
Profiles
Chaining
Naming conventions
Asynchronous mapping
Flattening and nesting