You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today you can bind TableAttribute to a JArray. Acting as a user, I assumed that also meant that I could bind to T[] (array of pocos). This doesn't work currently.
As part of the Table binding overhaul, I think we should enable this as well? For Table binding usages pulling in a collection JArray, T[], etc. are natural.
The text was updated successfully, but these errors were encountered:
Although a counter-point to consider: If we read T[], then the underlying table call can do a select to only pull down properties on T. Whereas if we read a JArray , then we need to pull down everything first (even unused properties).
We could solve this with a JArray --> T[] rule. This approach also lets T be a poco (and not need to derive from ITableEntity). Table could override specifically to optimize with a projection of just T's properties.
Perhaps ConverterManager should special case JArray-->T[]?
converterManager.AddConverter<JArray, OpenType[], TableAttribute>(typeof(JArrayToArrayConverter<>));
private class JArrayToArrayConverter<T> : IConverter<JArray, T[]>
{
public T[] Convert(JArray input)
{
if (input == null)
{
throw new ArgumentNullException("input");
}
return input.ToObject<T[]>();
}
}
Today you can bind TableAttribute to a JArray. Acting as a user, I assumed that also meant that I could bind to T[] (array of pocos). This doesn't work currently.
As part of the Table binding overhaul, I think we should enable this as well? For Table binding usages pulling in a collection JArray, T[], etc. are natural.
The text was updated successfully, but these errors were encountered: