public static ObjectExtensionManager AddOrUpdateProperty <TProperty>(
     [NotNull] this ObjectExtensionManager objectExtensionManager,
     [NotNull] Type[] objectTypes,
     [NotNull] string propertyName,
     [CanBeNull] Action <ObjectExtensionPropertyInfo> configureAction = null)
 {
     return(objectExtensionManager.AddOrUpdateProperty(
                objectTypes,
                typeof(TProperty),
                propertyName, configureAction
                ));
 }
 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
                ));
 }
예제 #3
0
        public static ObjectExtensionManager MapEfCoreProperty(
            [NotNull] this ObjectExtensionManager objectExtensionManager,
            [NotNull] Type entityType,
            [NotNull] Type propertyType,
            [NotNull] string propertyName)
        {
            Check.NotNull(objectExtensionManager, nameof(objectExtensionManager));

            return(objectExtensionManager.AddOrUpdateProperty(
                       entityType,
                       propertyType,
                       propertyName,
                       options => { options.MapEfCore(); }
                       ));
        }
예제 #4
0
        public static ObjectExtensionManager MapEfCoreProperty(
            [NotNull] this ObjectExtensionManager objectExtensionManager,
            [NotNull] Type entityType,
            [NotNull] Type propertyType,
            [NotNull] string propertyName,
            [CanBeNull] Action <EntityTypeBuilder, PropertyBuilder> entityTypeAndPropertyBuildAction)
        {
            Check.NotNull(objectExtensionManager, nameof(objectExtensionManager));

            return(objectExtensionManager.AddOrUpdateProperty(
                       entityType,
                       propertyType,
                       propertyName,
                       options =>
            {
                options.MapEfCore(
                    entityTypeAndPropertyBuildAction
                    );
            }
                       ));
        }
        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);
        }