Exemplo n.º 1
0
        public async Task <string> RunAsync(object model = null)
        {
            if (model != null && model.IsAnonymous())
            {
                model = new AnonymousTypeWrapper(model);
            }

            IRazorEngineTemplate instance = (IRazorEngineTemplate)Activator.CreateInstance(this.templateType);

            instance.Model = model;

            await instance.ExecuteAsync();

            return(await instance.ResultAsync());
        }