BindToFolderGeneric<TFolder extends Folder> method

Future<TFolder> BindToFolderGeneric<TFolder extends Folder>(
  1. FolderId folderId,
  2. PropertySet propertySet
)
Binds to folder. The folder id. The property set.

Implementation

Future<TFolder> BindToFolderGeneric<TFolder extends Folder>(
    FolderId folderId, PropertySet propertySet) async {
  Folder? result = await this.BindToFolder(folderId, propertySet);

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