Interface IDocumentDAL
Generic document data access interface.
Namespace: Microsoft.GNS.Roster.DataAccess
Assembly: Microsoft.GNS.Roster.DataAccess.dll
Syntax
public interface IDocumentDAL
Methods
View SourceDeleteDocumentAsync(IRosterDocument)
Deletes a document.
Declaration
Task DeleteDocumentAsync(IRosterDocument document)
Parameters
Type | Name | Description |
---|---|---|
IRosterDocument | document | The document to delete. |
Returns
Type | Description |
---|---|
Task | A task representing the work to delete the document. |
GetDocumentByIdAsync(Guid, IRosterDocument)
Gets a specific document by id.
Declaration
Task<IRosterDocument> GetDocumentByIdAsync(Guid id, IRosterDocument notFoundDefault)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The Id of the document to get. |
IRosterDocument | notFoundDefault | A default value to return when the object is not found. |
Returns
Type | Description |
---|---|
Task<IRosterDocument> | An object that represents a document in Roster. |
GetDocumentByNameAsync(String, String, Scope, IRosterDocument)
Gets a document by name.
Declaration
Task<IRosterDocument> GetDocumentByNameAsync(string name, string container, Scope scope, IRosterDocument notFoundDefault)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the document. |
System.String | container | The name of the document container. |
Scope | scope | The scope of the document container. |
IRosterDocument | notFoundDefault | A default value to return when the object is not found. |
Returns
Type | Description |
---|---|
Task<IRosterDocument> | An object that represent a document in Roster. |
GetDocumentsByOwnerAsync(Guid, String, Scope)
Gets all documents for a given owner.
Declaration
IAsyncEnumerable<IRosterDocument> GetDocumentsByOwnerAsync(Guid owner, string container, Scope scope)
Parameters
Type | Name | Description |
---|---|---|
Guid | owner | The owner of the document. |
System.String | container | The name of the document container. |
Scope | scope | The scope of the document container. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterDocument> | An async enumerable list of IRosterDocument. |
GetDocumentsFromContainerAsync(String, Scope, Boolean)
Gets all documents for the given containers.
Declaration
IAsyncEnumerable<IRosterDocument> GetDocumentsFromContainerAsync(string container, Scope scope, bool includeUserDocuments = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | container | The name of the document container. |
Scope | scope | The scope of the document container. |
System.Boolean | includeUserDocuments | If true, also retrieve user documents. If false, exclude user documents. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterDocument> | An async enumerable list of IRosterDocument. |
SaveDocumentAsync(IRosterDocument)
Saves a document.
Declaration
Task<IRosterDocument> SaveDocumentAsync(IRosterDocument document)
Parameters
Type | Name | Description |
---|---|---|
IRosterDocument | document | The document to save. |
Returns
Type | Description |
---|---|
Task<IRosterDocument> | The saved document as an IRosterDocument. |
SearchAsync(Scope, Func<IQueryable<IRosterDocument>, IQueryable<IRosterDocument>>)
Searches for documents given the provided query.
Declaration
IAsyncEnumerable<IRosterDocument> SearchAsync(Scope scope, Func<IQueryable<IRosterDocument>, IQueryable<IRosterDocument>> query)
Parameters
Type | Name | Description |
---|---|---|
Scope | scope | The scope of the query. |
Func<IQueryable<IRosterDocument>, IQueryable<IRosterDocument>> | query | The base query method. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IRosterDocument> | A list of objects that implement IRosterDocument. |