Exemplo n.º 1
0
        /// <summary>
        /// Specifies how the incoming should be cast from one value to another
        /// </summary>
        /// <param name="transformation">Transformation Value</param>
        /// <typeparam name="TCast">Inteded output type</typeparam>
        /// <returns></returns>
        public AnalyticalChild <TParent, T> HasTransformation <TCast>(Func <object, TCast> transformation)
        {
            PopulateTypeMaps(new NodeProperties()
            {
                Transformation = MasterWrappers.MasterFunctionWrapper(transformation),
            }, parentName, Name, true);

            return(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Takes in a lambda that returns an object of the same incoming type,
        /// returning a new value after applying the transformation.
        /// If the incoming value is null, the default value will be used.
        /// </summary>
        /// <param name="transformation">Transformation Lambda</param>
        /// <param name="defaultValue">Default v</param>
        /// <returns></returns>
        public AnalyticalChild <TParent, T> HasTransformation(Func <T, T> transformation, object defaultValue)
        {
            PopulateTypeMaps(new NodeProperties()
            {
                Transformation = MasterWrappers.MasterFunctionWrapper(transformation, defaultValue),
            }, parentName, Name, true);

            return(this);
        }
Exemplo n.º 3
0
 public void AddTransformation <T, TCast>(string key, Func <T, T> transformation, object defaultValue)
 {
     _transformations[key] = MasterWrappers.MasterFunctionWrapper(transformation, defaultValue);
 }
Exemplo n.º 4
0
 public void AddTransformation <T, TCast>(string key, Func <object, TCast> transformation)
 {
     _transformations[key] = MasterWrappers.MasterFunctionWrapper(transformation);
 }
Exemplo n.º 5
0
 public void AddTransformation <T>(string key, Func <T, T> transformation)
 {
     _transformations[key] = o => MasterWrappers.MasterFunctionWrapper(transformation, o);
 }
Exemplo n.º 6
0
 public void AddTransformation <T, TCast>(InternalType key, Func <T, T> transformation, object defaultValue)
 {
     _transformations[key.typeString] = MasterWrappers.MasterFunctionWrapper(transformation, defaultValue);
 }
Exemplo n.º 7
0
 public void AddTransformation <T, TCast>(InternalType key, Func <object, TCast> transformation)
 {
     _transformations[key.typeString] = MasterWrappers.MasterFunctionWrapper(transformation);
 }