Show / Hide Table of Contents

Interface IReadOnlyProperty_Item<T>

Represents a property of type item

Inherited Members
IReadOnlyElement.Attribute(String)
IReadOnlyElement.Attributes()
IReadOnlyElement.Elements()
IReadOnlyElement.AmlContext
IReadOnlyElement.Exists
IReadOnlyElement.Name
IReadOnlyElement.Parent
IReadOnlyElement.Value
IAmlNode.ToAml(XmlWriter, AmlWriterSettings)
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IReadOnlyProperty_Item<in T> : IReadOnlyProperty_Base, IReadOnlyElement, IAmlNode
Type Parameters
Name Description
T

Methods

| Improve this Doc View Source

AsGuid()

Value converted to a System.Nullable<T>. If the value cannot be converted, an exception is thrown

Declaration
Guid? AsGuid()
Returns
Type Description
System.Nullable<System.Guid>

A System.Guid or null if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.Guid

| Improve this Doc View Source

AsGuid(Guid)

Value converted to a System.Guid using the defaultValue if null. If the value cannot be converted, an exception is thrown

Declaration
Guid AsGuid(Guid defaultValue)
Parameters
Type Name Description
System.Guid defaultValue

The default value to return if the value is empty

Returns
Type Description
System.Guid

A System.Guid or defaultValue if the value is empty

Exceptions
Type Condition
System.InvalidCastException

If the non-empty value cannot be converted to a System.Guid

| Improve this Doc View Source

AsItem()

Value converted to a IReadOnlyItem. If the value cannot be converted, a 'null' item (where the Exists property returns false) is returned

Declaration
IReadOnlyItem AsItem()
Returns
Type Description
IReadOnlyItem
Examples

After executing the code

var item = aml.FromXml(@"<Item type='File'>
 <created_by_id keyed_name="John Smith" type="User">A5CE5E3B4E3846D8A15C1C9300EAF7B4</created_by_id>
</Item>").AssertItem();
var creator = item.CreatedById().AsItem();

the structure of creator will be

<Item type='User' id='A5CE5E3B4E3846D8A15C1C9300EAF7B4'gt;
 <id keyed_name="John Smith" type="User">A5CE5E3B4E3846D8A15C1C9300EAF7B4</id>
 <keyed_name>John Smith</keyed_name>
</Item>

Extension Methods

Core.Condition(IReadOnlyProperty_Base)
Core.IsNull(IReadOnlyProperty_Base)
Core.KeyedName(IReadOnlyProperty_Base)
Core.Type(IReadOnlyProperty_Base)
ItemExtensions.AsClrValue(IReadOnlyProperty_Base, Property)
ItemExtensions.ToAml(IAmlNode, AmlWriterSettings)
ItemExtensions.ToAml(IAmlNode, XmlWriter)
ItemExtensions.Element(IReadOnlyElement, String)
ItemExtensions.HasValue(IReadOnlyProperty_Base)
ItemExtensions.ToXml(IAmlNode)
ItemExtensions.CreateReader(IReadOnlyElement)
ItemExtensions.Parents(IReadOnlyElement)
ItemExtensions.ParentsAndSelf(IReadOnlyElement)
ItemExtensions.InnerText(IReadOnlyElement)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX