C# Class Hypermedia.Metadata.ContractExtensions

Show file Open project: cosullivan/Hypermedia

Public Methods

Method Description
CreateInstance ( this type ) : object

Creates an instance of the CLR type.

Field ( this contract, string name ) : IField

Returns the field with the given name.

Fields ( this contract, FieldOptions option ) : IEnumerable

Returns all fields that have the supplied set of options.

Fields ( this contract, bool>.Func predicate ) : IEnumerable

Returns all fields that match the predicate.

GetId ( this contract, object instance ) : object

Gets the ID for the entity.

Relationship ( this contract, string name ) : IRelationship

Returns the relationship with the given name.

Relationships ( this contract ) : IEnumerable

Return the relationships for the contract.

Relationships ( this contract, bool>.Func predicate ) : IEnumerable

Returns all relationships that match the predicate.

Method Details

CreateInstance() public static method

Creates an instance of the CLR type.
public static CreateInstance ( this type ) : object
type this The resource to create the CLR instance type for.
return object

Field() public static method

Returns the field with the given name.
public static Field ( this contract, string name ) : IField
contract this The type to return the field from.
name string The name of the field to return.
return IField

Fields() public static method

Returns all fields that have the supplied set of options.
public static Fields ( this contract, FieldOptions option ) : IEnumerable
contract this The contract to return the fields from.
option FieldOptions The option to return the fields with.
return IEnumerable

Fields() public static method

Returns all fields that match the predicate.
public static Fields ( this contract, bool>.Func predicate ) : IEnumerable
contract this The contract to return the fields from.
predicate bool>.Func The predicate to apply to the fields to determine if they should be returned.
return IEnumerable

GetId() public static method

Gets the ID for the entity.
public static GetId ( this contract, object instance ) : object
contract this The contract to perform the operation on.
instance object The instance to return the ID from.
return object

Relationship() public static method

Returns the relationship with the given name.
public static Relationship ( this contract, string name ) : IRelationship
contract this The type to return the relationship from.
name string The name of the relationship to return.
return IRelationship

Relationships() public static method

Return the relationships for the contract.
public static Relationships ( this contract ) : IEnumerable
contract this The contract to return the relationships for.
return IEnumerable

Relationships() public static method

Returns all relationships that match the predicate.
public static Relationships ( this contract, bool>.Func predicate ) : IEnumerable
contract this The contract to return the relationships from.
predicate bool>.Func The predicate to apply to the relationships to determine if they should be returned.
return IEnumerable