Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/Nest/Mapping/DynamicTemplate/SingleMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,30 +250,6 @@ public IProperty Scalar(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field,
) =>
selector.InvokeOrDefault(new DatePropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T,DateTimeOffset>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, DateTimeOffset?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) => selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) => selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field));

public IProperty Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null) =>
selector.InvokeOrDefault(new BooleanPropertyDescriptor<T>().Name(field));

Expand Down
52 changes: 0 additions & 52 deletions src/Nest/Mapping/Types/Properties-Scalar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,6 @@ public partial interface IPropertiesDescriptor<T, out TReturnType>

TReturnType Scalar(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DatePropertyDescriptor<T>, IDateProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, DateTimeOffset>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, DateTimeOffset?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null);

TReturnType Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null);

TReturnType Scalar(Expression<Func<T, bool?>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null);
Expand Down Expand Up @@ -404,42 +388,6 @@ public PropertiesDescriptor<T> Scalar(Expression<Func<T, IEnumerable<DateTimeOff
) =>
SetProperty(selector.InvokeOrDefault(new DatePropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTime>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTime?>> field, Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTime>>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTime?>>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTimeOffset>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, DateTimeOffset?>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset>>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> ScalarNanos(Expression<Func<T, IEnumerable<DateTimeOffset?>>> field,
Func<DateNanosPropertyDescriptor<T>, IDateNanosProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new DateNanosPropertyDescriptor<T>().Name(field)));

public PropertiesDescriptor<T> Scalar(Expression<Func<T, bool>> field, Func<BooleanPropertyDescriptor<T>, IBooleanProperty> selector = null
) =>
SetProperty(selector.InvokeOrDefault(new BooleanPropertyDescriptor<T>().Name(field)));
Expand Down
26 changes: 0 additions & 26 deletions src/Tests/Tests/Mapping/Scalar/ScalarUsageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ public enum ScalarEnum
dateTimeOffsets = new { type = "date" },
dateTimeOffsetNullable = new { type = "date" },
dateTimeOffsetNullables = new { type = "date" },
dateTimeNanos = new { type = "date_nanos" },
dateTimeNanoss = new { type = "date_nanos" },
dateTimeNanosNullable = new { type = "date_nanos" },
dateTimeNanosNullables = new { type = "date_nanos" },
dateTimeNanosOffset = new { type = "date_nanos" },
dateTimeNanosOffsets = new { type = "date_nanos" },
dateTimeNanosOffsetNullable = new { type = "date_nanos" },
dateTimeNanosOffsetNullables = new { type = "date_nanos" },
@decimal = new { type = "double" },
decimals = new { type = "double" },
decimalNullable = new { type = "double" },
Expand Down Expand Up @@ -153,14 +145,6 @@ public enum ScalarEnum
.Scalar(p => p.DateTimeOffsets, m => m)
.Scalar(p => p.DateTimeOffsetNullable, m => m)
.Scalar(p => p.DateTimeOffsetNullables, m => m)
.ScalarNanos(p => p.DateTimeNanos, m => m)
.ScalarNanos(p => p.DateTimeNanoss, m => m)
.ScalarNanos(p => p.DateTimeNanosNullable, m => m)
.ScalarNanos(p => p.DateTimeNanosNullables, m => m)
.ScalarNanos(p => p.DateTimeNanosOffset, m => m)
.ScalarNanos(p => p.DateTimeNanosOffsets, m => m)
.ScalarNanos(p => p.DateTimeNanosOffsetNullable, m => m)
.ScalarNanos(p => p.DateTimeNanosOffsetNullables, m => m)
.Scalar(p => p.Bool, m => m)
.Scalar(p => p.Bools, m => m)
.Scalar(p => p.BoolNullable, m => m)
Expand Down Expand Up @@ -216,16 +200,6 @@ public class ScalarPoco
public IEnumerable<DateTimeOffset> DateTimeOffsets { get; set; }
public IEnumerable<DateTime> DateTimes { get; set; }

public DateTime DateTimeNanos { get; set; }
public DateTime? DateTimeNanosNullable { get; set; }
public IEnumerable<DateTime?> DateTimeNanosNullables { get; set; }

public DateTimeOffset DateTimeNanosOffset { get; set; }
public DateTimeOffset? DateTimeNanosOffsetNullable { get; set; }
public IEnumerable<DateTimeOffset?> DateTimeNanosOffsetNullables { get; set; }
public IEnumerable<DateTimeOffset> DateTimeNanosOffsets { get; set; }
public IEnumerable<DateTime> DateTimeNanoss { get; set; }

public decimal Decimal { get; set; }
public decimal? DecimalNullable { get; set; }
public IEnumerable<decimal?> DecimalNullables { get; set; }
Expand Down