Table of Contents

Class ConceptExtensions

Namespace
Cratis.Concepts
Assembly
Cratis.Fundamentals.dll

Provides extensions related to types and others related to ConceptAs<T>.

public static class ConceptExtensions
Inheritance
ConceptExtensions
Inherited Members

Methods

GetConceptValue(object)

Takes a Concept{T} value object as an object and returns the correct primitive value, also as an object.

public static object GetConceptValue(this object conceptObject)

Parameters

conceptObject object

The concept as an object.

Returns

object

The value of the primitive type on which the concept is based.

Exceptions

TypeIsNotAConcept

Thrown if type is not a concept.

GetConceptValueType(Type)

Get the type of the value inside a ConceptAs<T>.

public static Type GetConceptValueType(this Type type)

Parameters

type Type

Type to get value type from.

Returns

Type

The type of the ConceptAs<T> value.

IsConcept(object)

Check if an object is an instance of a concept or not.

public static bool IsConcept(this object instance)

Parameters

instance object

instance to check.

Returns

bool

True if object is a concept, false if not.

IsConcept(Type)

Check if a type is a concept or not.

public static bool IsConcept(this Type objectType)

Parameters

objectType Type

Type to check.

Returns

bool

True if type is a concept, false if not.