Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

If you're using ASP.NET MVC and are using the HTML helper DisplayFor or EditorFor to render a partial view and you, in runtime, get a nasty InvalidOperationException, saying ...
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
... it might be because you have been over-zealous and typed your Model object's property as an interface (say ICollection) instead of a concrete type (say List).

Just sayin'.

Comments

Popular posts from this blog

Auto Mapper and Record Types - will they blend?

Unit testing your Azure functions - part 2: Queues and Blobs

Testing WCF services with user credentials and binary endpoints