public SQLNET ValNullable(SqlString key, object value)
{
Type type;
value = SqlTypeHelper.ConvertToType(value);
// CHECK for key containing type: int? x
if (key.Value.Contains(" "))
{
var split = key.Value.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (split.Length == 1)
{
type = value.GetType();
key = key.Value.Trim();
}
else if (split.Length == 2)
{
type = TypeHelper.GetTypeFromName(split[0]);
key = split[1];
}
else
{
throw new Exception(string.Format(ExceptionMessage.Invalid_ValueKey, key));
}
}
else
{
type = value.GetType();
}
return InternalValue(key, type, value);
}