in src/WebJobs.Extensions.MobileApps/Bindings/MobileTableItemValueBinder.cs [39:70]
public async Task<object> GetValueAsync()
{
object item = null;
if (typeof(T) == typeof(JObject))
{
IMobileServiceTable table = _context.Client.GetTable(_context.ResolvedAttribute.TableName);
await IgnoreNotFoundExceptionAsync(async () =>
{
item = await table.LookupAsync(_context.ResolvedAttribute.Id);
_originalItem = CloneItem(item);
});
}
else
{
// If TableName is specified, add it to the internal table cache. Now items of this type
// will operate on the specified TableName.
if (!string.IsNullOrEmpty(_context.ResolvedAttribute.TableName))
{
_context.Client.AddToTableNameCache(typeof(T), _context.ResolvedAttribute.TableName);
}
IMobileServiceTable<T> table = _context.Client.GetTable<T>();
await IgnoreNotFoundExceptionAsync(async () =>
{
item = await table.LookupAsync(_context.ResolvedAttribute.Id);
_originalItem = CloneItem(item);
});
}
return item;
}