private static bool ColumnTrackerIndicatorFactory(Type type, string propertyName) { Type entityType = type.GetEntityType(); SkipTrackingAttribute skipTrackingAttribute = entityType.GetProperty(propertyName) .GetCustomAttributes(false) .OfType <SkipTrackingAttribute>() .SingleOrDefault(); return(skipTrackingAttribute == null || !skipTrackingAttribute.Enabled); }
internal static TrackingConfigurationValue PropertyConfigValueFactory(string propertyName, Type entityType) { SkipTrackingAttribute skipTrackingAttribute = entityType.GetProperty(propertyName) .GetCustomAttributes(false) .OfType <SkipTrackingAttribute>() .SingleOrDefault(); bool trackValue = skipTrackingAttribute == null; return(new TrackingConfigurationValue(trackValue)); }
internal static TrackingConfigurationValue PropertyConfigValueFactory(string propertyName, Type entityType) { //if property is missing from the model assume it is not tracked PropertyInfo pi = entityType.GetProperty(propertyName); bool trackValue = false; if (pi != null) { SkipTrackingAttribute skipTrackingAttribute = pi.GetCustomAttributes(false) .OfType <SkipTrackingAttribute>() .SingleOrDefault(); trackValue = skipTrackingAttribute == null; } return(new TrackingConfigurationValue(trackValue)); }