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