Sitecore glass editable cannot convert lambda expression

为君一笑 提交于 2019-12-11 04:08:42

问题


I'm using Sitecore 7.5, MVC 5.2 and Glass Mapper 3.2.

When using Editable() in the renderings, the error below is shown in visual studio even though it renders properly when using the site and/or the page editor. Am I missing a reference or something?

Error:
"Cannot convert lambda expression to type 'System.Linq.Expressions.Expression>' because it is not a delegate type"

View

@using Sitecore.Mvc
@using Sitecore.Mvc.Presentation

@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<Air.SitecoreModels.Metadata>

@*<h1>@Model.Item.Name </h1>*@

<h2>@Editable(x => x.BrowserTitle)</h2>

Model (auto generated with TDS)

[SitecoreType(TemplateId=IMetadataConstants.TemplateIdString )] //, Cachable = true 
public partial interface IMetadata : IGlassBase 
{
    /// <summary>
    /// The BrowserTitle field.
    /// <para></para>
    /// <para>Field Type: Single-Line Text</para>       
    /// <para>Field ID: 82cb07ca-0f04-442e-9a42-641d71540b35</para>
    /// <para>Custom Data: </para>
    /// </summary>
    [SitecoreField(IMetadataConstants.BrowserTitleFieldName)]
    string BrowserTitle  {get; set;}

                /// <summary>
    /// The PageTitle field.
    /// <para></para>
    /// <para>Field Type: Single-Line Text</para>       
    /// <para>Field ID: 462e2170-1157-4e9d-92dc-0d5da2956c44</para>
    /// <para>Custom Data: </para>
    /// </summary>
    [SitecoreField(IMetadataConstants.PageTitleFieldName)]
    string PageTitle  {get; set;}

}


[SitecoreType(TemplateId=IMetadataConstants.TemplateIdString, AutoMap=true)] //, Cachable = true
public partial class Metadata  : GlassBase, IMetadata 
{

    /// <summary>
    /// The BrowserTitle field.
    /// <para></para>
    /// <para>Field Type: Single-Line Text</para>       
    /// <para>Field ID: 82cb07ca-0f04-442e-9a42-641d71540b35</para>
    /// <para>Custom Data: </para>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Team Development for Sitecore - GlassItem.tt", "1.0")]
    [SitecoreField(IMetadataConstants.BrowserTitleFieldName)]
    public virtual string BrowserTitle  {get; set;}

            /// <summary>
    /// The PageTitle field.
    /// <para></para>
    /// <para>Field Type: Single-Line Text</para>       
    /// <para>Field ID: 462e2170-1157-4e9d-92dc-0d5da2956c44</para>
    /// <para>Custom Data: </para>
    /// </summary>
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Team Development for Sitecore - GlassItem.tt", "1.0")]
    [SitecoreField(IMetadataConstants.PageTitleFieldName)]
    public virtual string PageTitle  {get; set;}                        
}

来源:https://stackoverflow.com/questions/26578805/sitecore-glass-editable-cannot-convert-lambda-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!