Interface IReadOnlyResult
Represents a read-only result of an Aras query that can either be a string, an exception, or zero or more items
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IReadOnlyResult : IAmlNode
Remarks
The result of an Aras query might take one of the following forms:
| Single Item | To access the item, use the AssertItem(String) method |
| Item Collection | To access the items, use the Items() method |
| String Result | To access the string, use the Value property |
| Error | To access the error, use the Exception property. The other methods/properties will raise this exception if accessed. |
Properties
| Improve this Doc View SourceException
Return an exception (if there is one), otherwise, return null
Declaration
ServerException Exception { get; }
Property Value
| Type | Description |
|---|---|
| ServerException |
Message
Get messages (such as permissions warnings) from the database
Declaration
IReadOnlyElement Message { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyElement |
Value
Return the string value of the result
Declaration
string Value { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceAssertItem(String)
Return a single item. If that is not possible, throw an appropriate exception (e.g. the exception returned by the server where possible)
Declaration
IReadOnlyItem AssertItem(string type = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | type | If specified, throw an exception if the item doesn't have the specified type |
Returns
| Type | Description |
|---|---|
| IReadOnlyItem | A single IReadOnlyItem |
Exceptions
| Type | Condition |
|---|---|
| ServerException | If the result does not represent exactly one item, either the exception returned from the server or a new exception will be thrown |
AssertItems()
Return an enumerable of items. Throw an exception for any error including 'No items found'
Declaration
IEnumerable<IReadOnlyItem> AssertItems()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IReadOnlyItem> |
Exceptions
| Type | Condition |
|---|---|
| ServerException | If the result does not have at least one item, either the exception returned from the server or a new exception will be thrown |
AssertNoError()
Do nothing other than throw an exception if there is an error other than 'No Items Found'
Declaration
IReadOnlyResult AssertNoError()
Returns
| Type | Description |
|---|---|
| IReadOnlyResult |
Exceptions
| Type | Condition |
|---|---|
| ServerException | If the exception returned from the server is anything other than NoItemsFoundException, the exception will be thrown |
Items()
Return an enumerable of items. Throw an exception if there is an error other than 'No Items Found'
Declaration
IEnumerable<IReadOnlyItem> Items()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IReadOnlyItem> |
Exceptions
| Type | Condition |
|---|---|
| ServerException | If the exception returned from the server is anything other than NoItemsFoundException, the exception will be thrown |