DocumentManagerServiceExtensions.FindDocumentByIdOrCreate(IDocumentManagerService, Object, Func<IDocumentManagerService, IDocument>) Method

Static extension method that retrieves the document by the specified identifier. If a document with such an identifier does not exist, it will be created.

Namespace: DevExpress.Mvvm

Assembly: DevExpress.Mvvm.v20.2.dll

Declaration

public static IDocument FindDocumentByIdOrCreate(
    this IDocumentManagerService service,
    object id,
    Func<IDocumentManagerService, IDocument> createDocumentCallback
)
<ExtensionAttribute>
Public Shared Function FindDocumentByIdOrCreate(
    service As IDocumentManagerService,
    id As Object,
    createDocumentCallback As Func(Of IDocumentManagerService, IDocument)
) As IDocument

Parameters

Name Type Description
service IDocumentManagerService

The type the static extension method operates with.

id Object

An System.Object object that represents the document's IDocument.Id.

createDocumentCallback Func<IDocumentManagerService, IDocument>

A System.Func object specifying the Callback function of the document creation.

Returns

Type Description
IDocument

An object implementing the IDocument interface.

Remarks

To learn more about Callback functions, refer to Callback Functions.

See Also