@@ -19,6 +19,7 @@ public interface ITypeMapping
1919
2020 [ JsonProperty ( "transform" ) ]
2121 [ JsonConverter ( typeof ( MappingTransformCollectionJsonConverter ) ) ]
22+ [ Obsolete ( "Deprecated in 2.0. Will be removed in the next major version release." ) ]
2223 IList < IMappingTransform > Transform { get ; set ; }
2324
2425 [ JsonProperty ( "analyzer" ) ]
@@ -108,6 +109,7 @@ public class TypeMapping : ITypeMapping
108109 [ Obsolete ( "use a normal date field and set its value explicitly" ) ]
109110 public ITimestampField TimestampField { get ; set ; }
110111 /// <inheritdoc/>
112+ [ Obsolete ( "Deprecated in 2.0. Will be removed in the next major version release." ) ]
111113 public IList < IMappingTransform > Transform { get ; set ; }
112114 /// <inheritdoc/>
113115 [ Obsolete ( "will be replaced with a different implementation in a future version of Elasticsearch" ) ]
@@ -136,6 +138,7 @@ public class TypeMappingDescriptor<T> : DescriptorBase<TypeMappingDescriptor<T>,
136138 ISourceField ITypeMapping . SourceField { get ; set ; }
137139 [ Obsolete ( "use a normal date field and set its value explicitly" ) ]
138140 ITimestampField ITypeMapping . TimestampField { get ; set ; }
141+ [ Obsolete ( "Deprecated in 2.0. Will be removed in the next major version release." ) ]
139142 IList < IMappingTransform > ITypeMapping . Transform { get ; set ; }
140143 [ Obsolete ( "will be replaced with a different implementation in a future version of Elasticsearch" ) ]
141144 ITtlField ITypeMapping . TtlField { get ; set ; }
@@ -198,25 +201,25 @@ public TypeMappingDescriptor<T> AutoMap(IPropertyVisitor visitor = null, int max
198201 public TypeMappingDescriptor < T > NumericDetection ( bool detect = true ) => Assign ( a => a . NumericDetection = detect ) ;
199202
200203 /// <inheritdoc/>
201- public TypeMappingDescriptor < T > Transform ( IEnumerable < IMappingTransform > transforms ) => Assign ( a => a . Transform = transforms . ToListOrNullIfEmpty ( ) ) ;
202-
203- /// <inheritdoc/>
204- public TypeMappingDescriptor < T > Transform ( Func < MappingTransformsDescriptor , IPromise < IList < IMappingTransform > > > selector ) =>
205- Assign ( a => a . Transform = selector ? . Invoke ( new MappingTransformsDescriptor ( ) ) ? . Value ) ;
204+ public TypeMappingDescriptor < T > RoutingField ( Func < RoutingFieldDescriptor < T > , IRoutingField > routingFieldSelector ) => Assign ( a => a . RoutingField = routingFieldSelector ? . Invoke ( new RoutingFieldDescriptor < T > ( ) ) ) ;
206205
207206 /// <inheritdoc/>
208- public TypeMappingDescriptor < T > RoutingField ( Func < RoutingFieldDescriptor < T > , IRoutingField > routingFieldSelector ) => Assign ( a => a . RoutingField = routingFieldSelector ? . Invoke ( new RoutingFieldDescriptor < T > ( ) ) ) ;
207+ public TypeMappingDescriptor < T > FieldNamesField ( Func < FieldNamesFieldDescriptor < T > , IFieldNamesField > fieldNamesFieldSelector ) => Assign ( a => a . FieldNamesField = fieldNamesFieldSelector . Invoke ( new FieldNamesFieldDescriptor < T > ( ) ) ) ;
209208
210209#pragma warning disable 618
211210 /// <inheritdoc/>
212211 [ Obsolete ( "use a normal date field and set its value explicitly" ) ]
213212 public TypeMappingDescriptor < T > TimestampField ( Func < TimestampFieldDescriptor < T > , ITimestampField > timestampFieldSelector ) => Assign ( a => a . TimestampField = timestampFieldSelector ? . Invoke ( new TimestampFieldDescriptor < T > ( ) ) ) ;
214- #pragma warning restore 618
215213
216214 /// <inheritdoc/>
217- public TypeMappingDescriptor < T > FieldNamesField ( Func < FieldNamesFieldDescriptor < T > , IFieldNamesField > fieldNamesFieldSelector ) => Assign ( a => a . FieldNamesField = fieldNamesFieldSelector . Invoke ( new FieldNamesFieldDescriptor < T > ( ) ) ) ;
215+ [ Obsolete ( "Deprecated in 2.0. Will be removed in the next major version release." ) ]
216+ public TypeMappingDescriptor < T > Transform ( IEnumerable < IMappingTransform > transforms ) => Assign ( a => a . Transform = transforms . ToListOrNullIfEmpty ( ) ) ;
217+
218+ /// <inheritdoc/>
219+ [ Obsolete ( "Deprecated in 2.0. Will be removed in the next major version release." ) ]
220+ public TypeMappingDescriptor < T > Transform ( Func < MappingTransformsDescriptor , IPromise < IList < IMappingTransform > > > selector ) =>
221+ Assign ( a => a . Transform = selector ? . Invoke ( new MappingTransformsDescriptor ( ) ) ? . Value ) ;
218222
219- #pragma warning disable 618
220223 /// <inheritdoc/>
221224 [ Obsolete ( "will be replaced with a different implementation in a future version of Elasticsearch" ) ]
222225 public TypeMappingDescriptor < T > TtlField ( Func < TtlFieldDescriptor , ITtlField > ttlFieldSelector ) => Assign ( a => a . TtlField = ttlFieldSelector ? . Invoke ( new TtlFieldDescriptor ( ) ) ) ;
0 commit comments