Developer forum

Forum » Templates » Null-propagation and other 6.0 features in templates.

Null-propagation and other 6.0 features in templates.

Simon Nordahl
Simon Nordahl
Reply

Hi all

Have anybody had success with incorporating c# 6.0 features in Dynamicweb templates?

Eg. Model?.Area.Culture?

I've tried with installing Microsoft.CodeDom.Providers.DotNetCompilerPlatform in the project which removes the build warnings in templates.

However when trying to use the new features in any Dynamicweb template will throw an compile error.

Having null propagation in the new viewmodels almost feel like a must have in order to avoid excessive codelines with model check for null values.


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

I think it would require a newer version of RazorEngine which handles the compilation and execution of razor templates.
Dynamicweb is currently using version 3.4.1 of RazorEngine, but support for Roslyn (DotNetCompilerPlatform) requires version 3.5.0 or later. Some core code in Dynamicweb must be changed as well. We have already tried to upgrade, but ran into some serious issues, so it has been postponed to a later release.

Best regards,
Morten

 

You must be logged in to post in the forum