Interface IDocumentRepository
Repository to load, save and delete documents from the database and also to manage more document related data.
Namespace: Simplic.Document
Assembly: Simplic.Document.dll
Syntax
public interface IDocumentRepository
Methods
| Improve this Doc View SourceAddVersion(DocumentVersion)
Adds and saves a document version.
Declaration
bool AddVersion(DocumentVersion version)
Parameters
Type | Name | Description |
---|---|---|
DocumentVersion | version | The document version. |
Returns
Type | Description |
---|---|
System.Boolean |
GetBlob(Guid)
Gets a blob from the archive database.
Declaration
byte[] GetBlob(Guid blobId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | blobId | The id of the blob. |
Returns
Type | Description |
---|---|
System.Byte[] |
GetByBlobId(Guid)
Gets the document by an assigned blob.
Declaration
Document GetByBlobId(Guid blobId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | blobId | The blob id. |
Returns
Type | Description |
---|---|
Document.Document |
GetDocumentFulltext(Guid)
Gets the document fulltext.
Declaration
string GetDocumentFulltext(Guid blobGuid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | blobGuid |
Returns
Type | Description |
---|---|
System.String |
GetId(Document)
Gets the id of the given object.
Declaration
Guid GetId(Document obj)
Parameters
Type | Name | Description |
---|---|---|
Document.Document | obj |
Returns
Type | Description |
---|---|
System.Guid |
GetMimeTypeByExtension(String)
Gets the mime type by the file extension.
Declaration
string GetMimeTypeByExtension(string fileExtension)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileExtension | The file extension as string. |
Returns
Type | Description |
---|---|
System.String |
GetNextDocumentId()
Gets the next document id.
Declaration
long GetNextDocumentId()
Returns
Type | Description |
---|---|
System.Int64 |
GetNextVersionId()
Gets the next document version id.
Declaration
long GetNextVersionId()
Returns
Type | Description |
---|---|
System.Int64 |
GetReleasedBlobGuid(Guid)
Gets the Guid of the released blob from the given document.
Declaration
Guid GetReleasedBlobGuid(Guid documentId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | documentId |
Returns
Type | Description |
---|---|
System.Guid |
GetVersions(Guid)
Gets all document version of a document.
Declaration
IEnumerable<DocumentVersion> GetVersions(Guid documentId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | documentId | The id of a document. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<DocumentVersion> |
ReleaseVersion(DocumentVersion)
Releases a new document version. (Sets a document version as released)
Declaration
bool ReleaseVersion(DocumentVersion version)
Parameters
Type | Name | Description |
---|---|---|
DocumentVersion | version | The document version. |
Returns
Type | Description |
---|---|
System.Boolean |
Restore(Guid)
Restores a document.
Declaration
bool Restore(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | guid |
Returns
Type | Description |
---|---|
System.Boolean | Whether at least one document is restored. |
SetBlob(Byte[], Guid)
Sets a blob with the given id.
Declaration
void SetBlob(byte[] pdfBlob, Guid blobId)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pdfBlob | The blob. |
System.Guid | blobId | The id that the blob will get. |
UpdateVersion(DocumentVersion)
Updates given version in data base.
Declaration
bool UpdateVersion(DocumentVersion version)
Parameters
Type | Name | Description |
---|---|---|
DocumentVersion | version | Version to be updated. |
Returns
Type | Description |
---|---|
System.Boolean |