# CustomSchemaMappingProvider

    public class CustomSchemaMappingProvider : Hashable, SchemaMappingProvider

A `SchemaMappingProvider` that accepts custom mappings for some entities. Mappings of entities with no `CustomMapping` provided will be automatically calculated if possible.

- `sourceVersion`

  The source model version for the mapping.

  #### Declaration

  Swift

      public let sourceVersion: ModelVersion

- `destinationVersion`

  The destination model version for the mapping.

  #### Declaration

  Swift

      public let destinationVersion: ModelVersion

- `init(from:to:entityMappings:)`

  Creates a `CustomSchemaMappingProvider`

  #### Declaration

  Swift

      public required init(from sourceVersion: ModelVersion, to destinationVersion: ModelVersion, entityMappings: Set<CustomMapping> = [])

  #### Parameters

  `sourceVersion` | the source model version for the mapping
  `destinationVersion` | the destination model version for the mapping
  `entityMappings` | a list of `CustomMapping`s. Mappings of entities with no `CustomMapping` provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

### CustomMapping

- `CustomMapping`

  Provides the type of mapping for an entity. Mappings of entities with no `CustomMapping` provided will be automatically calculated if possible. Any conflicts or ambiguity will raise an assertion.

  See more

  #### Declaration

  Swift

      public enum CustomMapping : Hashable

### UnsafeSourceObject

- `UnsafeSourceObject`

  The read-only proxy object used for the source object in a mapping’s `Transformer` closure. Properties can be accessed either by keyPath string or by `NSAttributeDescription`.

  See more

  #### Declaration

  Swift

      public final class UnsafeSourceObject

### UnsafeDestinationObject

- `UnsafeDestinationObject`

  The read-write proxy object used for the destination object that can be created in a mapping’s `Transformer` closure. Properties can be accessed and mutated either through keyPath string or by `NSAttributeDescription`.

  See more

  #### Declaration

  Swift

      public final class UnsafeDestinationObject

### Equatable

- `==(_:_:)`

  #### Declaration

  Swift

      public static func == (lhs: CustomSchemaMappingProvider, rhs: CustomSchemaMappingProvider) -> Bool

### Hashable

- `hash(into:)`

  #### Declaration

  Swift

      public func hash(into hasher: inout Hasher)

### SchemaMappingProvider

- `cs_createMappingModel(from:to:storage:)`

  #### Declaration

  Swift

      public func cs_createMappingModel(from sourceSchema: DynamicSchema, to destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType)