in src/DurableTask.AzureStorage/Tracking/TableEntityConverter.cs [256:301]
static bool IsSupportedType(Type type) =>
type == typeof(string) ||
type == typeof(byte[]) ||
type == typeof(bool) ||
type == typeof(bool?) ||
type == typeof(DateTime) ||
type == typeof(DateTime?) ||
type == typeof(DateTimeOffset) ||
type == typeof(DateTimeOffset?) ||
type == typeof(double) ||
type == typeof(double?) ||
type == typeof(Guid) ||
type == typeof(Guid?) ||
type == typeof(int) ||
type == typeof(int?) ||
type == typeof(long) ||
type == typeof(long?);
static MethodInfo GetEntityAccessor(Type type)
{
if (type == typeof(string))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetString), new Type[] { typeof(string) });
if (type == typeof(byte[]))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetBinary), new Type[] { typeof(string) });
if (type == typeof(bool) || type == typeof(bool?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetBoolean), new Type[] { typeof(string) });
if (type == typeof(DateTime) || type == typeof(DateTime?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetDateTime), new Type[] { typeof(string) });
if (type == typeof(DateTimeOffset) || type == typeof(DateTimeOffset?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetDateTimeOffset), new Type[] { typeof(string) });
if (type == typeof(double) || type == typeof(double?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetDouble), new Type[] { typeof(string) });
if (type == typeof(Guid) || type == typeof(Guid?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetGuid), new Type[] { typeof(string) });
if (type == typeof(int) || type == typeof(int?))
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetInt32), new Type[] { typeof(string) });
return typeof(TableEntity).GetMethod(nameof(TableEntity.GetInt64), new Type[] { typeof(string) });
}