BindToItemGeneric<TItem extends Item> method

Future<TItem> BindToItemGeneric<TItem extends Item>(
  1. ItemId? itemId,
  2. PropertySet propertySet
)
Binds to item. The item id. The property set.

Implementation

Future<TItem> BindToItemGeneric<TItem extends Item>(
    ItemId? itemId, PropertySet propertySet) async {
  Item? result = await this.BindToItem(itemId, propertySet);

  if (result is TItem) {
    return result;
  } else {
    throw new ServiceLocalException("""string.Format(
                      Strings.ItemTypeNotCompatible,
                      result.GetType().Name,
                      typeof(TItem).Name)""");
  }
}