Show / Hide Table of Contents

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
IAmlNode.ToAml(XmlWriter, AmlWriterSettings)
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 ItemTo access the item, use the AssertItem(String) method
Item CollectionTo access the items, use the Items() method
String ResultTo access the string, use the Value property
ErrorTo access the error, use the Exception property. The other methods/properties will raise this exception if accessed.

Properties

| Improve this Doc View Source

Exception

Return an exception (if there is one), otherwise, return null

Declaration
ServerException Exception { get; }
Property Value
Type Description
ServerException
| Improve this Doc View Source

Message

Get messages (such as permissions warnings) from the database

Declaration
IReadOnlyElement Message { get; }
Property Value
Type Description
IReadOnlyElement
| Improve this Doc View Source

Value

Return the string value of the result

Declaration
string Value { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AssertItem(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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

Extension Methods

ItemExtensions.AssertItem<T>(IReadOnlyResult)
ItemExtensions.ToAml(IAmlNode, AmlWriterSettings)
ItemExtensions.ToAml(IAmlNode, XmlWriter)
ItemExtensions.ItemMax(IReadOnlyResult)
ItemExtensions.ItemsWithNoAccessCount(IReadOnlyResult)
ItemExtensions.ToXml(IAmlNode)
ItemExtensions.CreateReader(IReadOnlyResult)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX