The () missing is caused by the fact for EF Core we support out of the box only system type converters, which are then mapped on valueconverters during code generation (see: https://www.llblgen.com/Documentation/5.6/Entity%20Framework/VCore22/SupportedConstructs.htm#value-conversions-through-type-converters.)
We added the () in the mapping as the name was there just for code generation. This way the () was always present but indeed using a custom type converter then doesn't work. We'll adjust the template.
So it was by design for now as we needed to deal with the difference in base type.
That said, we think there's a workaround. (which still requires the updated template btw): have a 'system typeconverter' for the type converter, which derives from TypeConverter and is simply used to make the designer work with it. The type name is the same as the real type converter. When code is generated it will emit the type converter in question into the code, but there you reference the assembly with the real type converter (which derives from valueconverter).
We'll test this with your conversion to see if we can achieve that.
A system type converter looks like this:
using System;
using System.ComponentModel;
namespace SD.LLBLGen.Pro.TypeConverters
{
/// <summary>
/// Definition of the Int16DecimalConverter. This converter uses 'Int16' as its core type and converts any decimal value to and from Int16
/// </summary>
/// <remarks>This class defines a System Type Converter, which means it is not able to convert any value, but defines which types can be
/// converted to/from using this type converter. System type converters are used by the LLBLGen Pro designer to define type conversions
/// and are mapped to real type converters / type conversion code by framework definition files for the target frameworks which support
/// the type converters.
/// <br/><br/>
/// Accepted types are: Decimal</remarks>
[Description("Converter with as core type System.Int16, for mapping a field with a .NET type System.Int16 onto a decimal database field")]
public class Int16DecimalConverter : SystemTypeConverterBase
{
/// <summary>
/// Checks the type if it's usable to convert to/from for this type converter.
/// </summary>
/// <param name="typeToCheck"></param>
/// <returns>
/// true if the type is usable for this type converter, false otherwise
/// </returns>
protected override bool CheckFromType(Type typeToCheck)
{
return typeToCheck == typeof(decimal);
}
/// <inheritdoc />
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(short);
}
/// <summary>
/// Creates an instance of the Type that this <see cref="T:System.ComponentModel.TypeConverter"/> is associated with (short)
/// </summary>
/// <param name="context">ignored.</param>
/// <param name="propertyValues">ignored.</param>
/// <returns>
/// An <see cref="T:System.Object"/> of type short. It always returns 0 for this converter.
/// </returns>
public override object CreateInstance(ITypeDescriptorContext context, System.Collections.IDictionary propertyValues)
{
return (short)0;
}
}
}
So it's a simple type which can return to the designer the right types/values for what it deals with. SystemTypeConverterBase is located in SD.LLBLGen.Pro.TypeConverters.dll, an assembly shipped with the designer in the folder <installation folder>\TypeConverters.
We'll get back to you regarding the updated template shortly.