Class TrackableExtensions
Class contains extension methods for ITrackable.
Inherited Members
Namespace: Loehnert.TypeAndResult.Tracking
Assembly: Loehnert.TypeAndResult.dll
Syntax
public static class TrackableExtensions
Methods
GetTrackableProperties(Type)
Gets the trackable properties of a type.
Declaration
public static IEnumerable<PropertyInfo> GetTrackableProperties(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | Type with trackable properties. |
Returns
Type | Description |
---|---|
IEnumerable<PropertyInfo> | Trackable properties for |
Remarks
Uses a cache.
IsRecursiveUnchanged(ITrackable)
Gets a value indicating whether entity
and all properties marked with the
RecursiveTrackedAttribute have the tracking state Unchanged.
Declaration
public static bool IsRecursiveUnchanged(this ITrackable entity)
Parameters
Type | Name | Description |
---|---|---|
ITrackable | entity | Trackable where the change depends on. |
Returns
Type | Description |
---|---|
Boolean | A value indicating whether the entity is recursive unchanged. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.InvalidOperationException | Thrown when a property is marked with the RecursiveTrackedAttribute that is ITrackable or System.Collections.IEnumerable. |
SetTrackingStateRecursive(ITrackable, TrackingState)
Sets the TrackingState to state
.
This is also done for all entities, that are contained in the properties that implement System.Collections.IEnumerable.
Declaration
public static void SetTrackingStateRecursive(this ITrackable entity, TrackingState state)
Parameters
Type | Name | Description |
---|---|---|
ITrackable | entity | Trackable for setting. |
TrackingState | state | State to set recursive. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.InvalidOperationException | Thrown when a property is reached, which has a RecursiveTrackedAttribute and is not ITrackable and System.Collections.IEnumerable. |