public static ObjectExtensionPropertyInfo GetPropertyOrNull( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Type objectType, [NotNull] string propertyName) { Check.NotNull(objectExtensionManager, nameof(objectExtensionManager)); Check.NotNull(objectType, nameof(objectType)); Check.NotNull(propertyName, nameof(propertyName)); return(objectExtensionManager .GetOrNull(objectType)? .GetPropertyOrNull(propertyName)); }
public static ObjectExtensionManager MapEfCoreProperty <TEntity, TProperty>( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] string propertyName, [CanBeNull] Action <PropertyBuilder> propertyBuildAction = null) where TEntity : IHasExtraProperties, IEntity { return(objectExtensionManager.MapEfCoreProperty( typeof(TEntity), typeof(TProperty), propertyName, propertyBuildAction )); }
public static ObjectExtensionManager AddOrUpdateProperty <TObject, TProperty>( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] string propertyName, [CanBeNull] Action <ObjectExtensionPropertyInfo> configureAction = null) where TObject : IHasExtraProperties { return(objectExtensionManager.AddOrUpdateProperty( typeof(TObject), typeof(TProperty), propertyName, configureAction )); }
public static ImmutableList <ObjectExtensionPropertyInfo> GetProperties( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Type objectType) { Check.NotNull(objectExtensionManager, nameof(objectExtensionManager)); Check.NotNull(objectType, nameof(objectType)); var extensionInfo = objectExtensionManager.GetOrNull(objectType); if (extensionInfo == null) { return(EmptyPropertyList); } return(extensionInfo.GetProperties()); }
public static ObjectExtensionManager AddOrUpdateProperty( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Type objectType, [NotNull] Type propertyType, [NotNull] string propertyName, [CanBeNull] Action <ObjectExtensionPropertyInfo> configureAction = null) { Check.NotNull(objectExtensionManager, nameof(objectExtensionManager)); return(objectExtensionManager.AddOrUpdate( objectType, options => { options.AddOrUpdateProperty( propertyType, propertyName, configureAction ); })); }
public static ObjectExtensionManager MapEfCoreProperty( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Type entityType, [NotNull] Type propertyType, [NotNull] string propertyName, [CanBeNull] Action <PropertyBuilder> propertyBuildAction = null) { Check.NotNull(objectExtensionManager, nameof(objectExtensionManager)); return(objectExtensionManager.AddOrUpdateProperty( entityType, propertyType, propertyName, options => { options.MapEfCore( propertyBuildAction ); } )); }
public static ObjectExtensionManager AddOrUpdateProperty( [NotNull] this ObjectExtensionManager objectExtensionManager, [NotNull] Type[] objectTypes, [NotNull] Type propertyType, [NotNull] string propertyName, [CanBeNull] Action <ObjectExtensionPropertyInfo> configureAction = null) { Check.NotNull(objectTypes, nameof(objectTypes)); foreach (var objectType in objectTypes) { objectExtensionManager.AddOrUpdateProperty( objectType, propertyType, propertyName, configureAction ); } return(objectExtensionManager); }
public static ImmutableList <ObjectExtensionPropertyInfo> GetProperties <TObject>( [NotNull] this ObjectExtensionManager objectExtensionManager) { return(objectExtensionManager.GetProperties(typeof(TObject))); }