예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TProperty"></typeparam>
 /// <param name="objectExtensionManager"></param>
 /// <param name="objectTypes"></param>
 /// <param name="propertyName"></param>
 /// <param name="configureAction"></param>
 /// <returns></returns>
 public static ObjectExtensionManager AddOrUpdateProperty <TProperty>(
     this ObjectExtensionManager objectExtensionManager,
     Type[] objectTypes,
     string propertyName,
     Action <ObjectExtensionPropertyInfo> configureAction = null)
 {
     return(objectExtensionManager.AddOrUpdateProperty(
                objectTypes,
                typeof(TProperty),
                propertyName, configureAction
                ));
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TObject"></typeparam>
 /// <typeparam name="TProperty"></typeparam>
 /// <param name="objectExtensionManager"></param>
 /// <param name="propertyName"></param>
 /// <param name="configureAction"></param>
 /// <returns></returns>
 public static ObjectExtensionManager AddOrUpdateProperty <TObject, TProperty>(
     this ObjectExtensionManager objectExtensionManager,
     string propertyName,
     Action <ObjectExtensionPropertyInfo> configureAction = null)
     where TObject : IHasExtraProperties
 {
     return(objectExtensionManager.AddOrUpdateProperty(
                typeof(TObject),
                typeof(TProperty),
                propertyName,
                configureAction
                ));
 }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="objectExtensionManager"></param>
        /// <param name="objectTypes"></param>
        /// <param name="propertyType"></param>
        /// <param name="propertyName"></param>
        /// <param name="configureAction"></param>
        /// <returns></returns>
        public static ObjectExtensionManager AddOrUpdateProperty(
            this ObjectExtensionManager objectExtensionManager,
            Type[] objectTypes,
            Type propertyType,
            string propertyName,
            Action <ObjectExtensionPropertyInfo> configureAction = null)
        {
            Check.NotNull(objectTypes, nameof(objectTypes));

            foreach (var objectType in objectTypes)
            {
                objectExtensionManager.AddOrUpdateProperty(
                    objectType,
                    propertyType,
                    propertyName,
                    configureAction
                    );
            }

            return(objectExtensionManager);
        }