Antaris/RazorEngine — Issue #22: Passing a dynamic object without a property that template is expecting gives the following error : 'System.Dynamic.DynamicObject' does not contain a definition for 'Property Name'
Author: ukarjee
Created: 2012-02-01 16:26:34+00:00
State: open

Passing a dynamic object without a property that template is expecting gives the following error : 'System.Dynamic.DynamicObject' does not contain a definition for 'PropertyName'.
Is there a way to have Razor disregard the properties that's not in the dynamic object?

Below is the example.

template = @"This is standard Email Template.
Name:@Model.FullName

By:@Model.Author.
@Model.PropertyName"

Parse Method:
Razor.Parse(template, new { FullName="F - name", Author="author.." })