src/Microsoft.DocAsCode.Build.Engine/Template.cs
/// <summary>
/// Transform from raw model to view model
/// TODO: refactor to merge model and attrs into one input model
/// </summary>
/// <param name="model">The raw model</param>
/// <param name="attrs">The system generated attributes</param>
/// <returns>The view model</returns>
Transform from raw model to view model
TODO: refactor to merge model and attrs into one input model
Transform from raw model to view model TODO : refactor to merge model and attrs into one input model
public object TransformModel(object model)
        {
            if (_preprocessorPool == null || !ContainsModelTransformation)
            {
                return model;
            }
            using (var lease = _preprocessorPool.Rent())
            {
                try
                {
                    return lease.Resource.TransformModelFunc(model);
                }
                catch (Exception e)
                {
                    throw new InvalidPreprocessorException($"Error running Transform function inside template preprocessor: {e.Message}");
                }
            }
        }
public object TransformModel ( object model ) { if ( _preprocessorPool == null || ! ContainsModelTransformation ) { return model ; } using ( var lease = _preprocessorPool . Rent ( ) ) { try { return lease . Resource . TransformModelFunc ( model ) ; } catch ( Exception e ) { throw new InvalidPreprocessorException ( $" Error running Transform function inside template preprocessor:  { e . Message } " ) ; } } }
Transform from raw model to view model
TODO: refactor to merge model and attrs into one input model
Transform from raw model to view model TODO : refactor to merge model and attrs into one input model
The view model
The view model
model
object
The raw model
The raw model
attrs
<not_specific>
The system generated attributes
The system generated attributes