Пример #1
0
 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
                ));
 }
Пример #2
0
 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 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
                    );
            }
                       ));
        }
Пример #4
0
        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);
        }