Skip to content

Commit

Permalink
Merge pull request #743 from caleblloyd/f_2.2.0_type_mapping
Browse files Browse the repository at this point in the history
Update type mapping Clone for 2.2.0
  • Loading branch information
caleblloyd authored Feb 7, 2019
2 parents f61c80a + 074d543 commit 121d741
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 132 deletions.
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlBoolTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,12 @@ protected MySqlBoolTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlBoolTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlBoolTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlBoolTypeMapping(parameters);

/// <summary>
/// Generates the SQL representation of a literal value.
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlByteArrayTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,12 @@ protected MySqlByteArrayTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlByteArrayTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlByteArrayTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlByteArrayTypeMapping(parameters);

private static int CalculateSize(int? size)
=> size.HasValue && size < MaxSize ? size.Value : MaxSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ protected MySqlDateTimeOffsetTypeMapping(RelationalTypeMappingParameters paramet
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlDateTimeOffsetTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlDateTimeOffsetTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlDateTimeOffsetTypeMapping(parameters);

/// <summary>
/// Gets the string format to be used to generate SQL literals of this type.
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlDateTimeTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,12 @@ protected MySqlDateTimeTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlDateTimeTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlDateTimeTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlDateTimeTypeMapping(parameters);

/// <summary>
/// Gets the string format to be used to generate SQL literals of this type.
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlDateTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,12 @@ protected MySqlDateTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlDateTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlDateTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlDateTypeMapping(parameters);

/// <summary>
/// Gets the string format to be used to generate SQL literals of this type.
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlDecimalTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,12 @@ protected MySqlDecimalTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlDecimalTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlDecimalTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlDecimalTypeMapping(parameters);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlDoubleTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ protected MySqlDoubleTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlDoubleTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlDoubleTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlDoubleTypeMapping(parameters);
}
}
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlFloatTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,12 @@ protected MySqlFloatTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlFloatTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlFloatTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlFloatTypeMapping(parameters);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlJsonTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,12 @@ protected MySqlJsonTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlJsonTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlJsonTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlJsonTypeMapping(parameters);

/// <summary>
/// Generates the escaped SQL representation of a literal value.
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlOldGuidTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ protected sealed override string GenerateNonNullSqlLiteral([CanBeNull] object va
=> ByteArrayFormatter.ToHex(((Guid)value).ToByteArray());

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlOldGuidTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlOldGuidTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlOldGuidTypeMapping(parameters);
}
}
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlStringTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,12 @@ private static int CalculateSize(bool unicode, int? size)
: size.HasValue && size <= AnsiMax ? size.Value : AnsiMax;

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlStringTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlStringTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlStringTypeMapping(parameters);

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
Expand Down
16 changes: 5 additions & 11 deletions src/EFCore.MySql/Storage/Internal/MySqlTimeSpanTypeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,12 @@ protected MySqlTimeSpanTypeMapping(RelationalTypeMappingParameters parameters)
}

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public override RelationalTypeMapping Clone(string storeType, int? size)
=> new MySqlTimeSpanTypeMapping(Parameters.WithStoreTypeAndSize(storeType, size));

/// <summary>
/// This API supports the Entity Framework Core infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// Creates a copy of this mapping.
/// </summary>
public override CoreTypeMapping Clone(ValueConverter converter)
=> new MySqlTimeSpanTypeMapping(Parameters.WithComposedConverter(converter));
/// <param name="parameters"> The parameters for this mapping. </param>
/// <returns> The newly created mapping. </returns>
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new MySqlTimeSpanTypeMapping(parameters);

/// <summary>
/// Gets the string format to be used to generate SQL literals of this type.
Expand Down

0 comments on commit 121d741

Please sign in to comment.