Interface IResourceCollection<TSelf, TModel, TResource>
The stateful model collection interface.
Inherited Members
System.IDisposable.Dispose()
System.Collections.Generic.IReadOnlyCollection<TModel>.Count
System.Collections.Generic.IEnumerable<TModel>.GetEnumerator()
Namespace: Microsoft.Graph.StatefulClient
Assembly: Microsoft.Graph.StatefulClient.dll
Syntax
public interface IResourceCollection<out TSelf, TModel, in TResource> : IResourceCollection, IDisposable, IReadOnlyCollection<TModel>, IEnumerable<TModel>, IEnumerable where TSelf : IResourceCollection<TSelf, TModel, TResource> where TModel : IResource<TModel, TResource> where TResource : Entity
Type Parameters
Name | Description |
---|---|
TSelf | The self type of the collection. |
TModel | The containing stateful resource type. IResource<TSelf, TResource> |
TResource | The containing resource type. Entity |
Properties
View SourceItem[String]
The resource at the specified index.
Declaration
TModel this[string id] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The index id. |
Property Value
Type | Description |
---|---|
TModel |
Methods
View SourceTryForceRemove(String, out TModel)
Attempts to remove and return the value that has the specified id from the IResourceCollection<TSelf, TModel, TResource>. This will force remove the object, if for whatever reason it cannot be removed by the service. It should only be used as a last resort to clean up stale resources.
Declaration
bool TryForceRemove(string id, out TModel model)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The identifier. |
TModel | model | The model. |
Returns
Type | Description |
---|---|
System.Boolean | true if the object was removed successfully; otherwise, false. |
Events
View SourceOnUpdated
Event triggered whenever a resource is updated from the collection.
Declaration
event CollectionEventHandler<TSelf, TModel> OnUpdated
Event Type
Type | Description |
---|---|
CollectionEventHandler<TSelf, TModel> |
Extension Methods
See Also
System.Collections.Generic.IReadOnlyCollection<T>