Sitecore Glass Mapper always null

前端 未结 3 1881
广开言路
广开言路 2020-12-20 19:37

I am using Sitecore Glass Mapper for a new project I\'m setting up. We are using Sitecore 7.2, latest version of Team Development for Sitecore (TDS) code generation and the

3条回答
  •  时光取名叫无心
    2020-12-20 19:47

    Most of the times it is a language issue. The mapper returns a null object when you do not have versions in the current or given language.

    What can be confusing is that Sitecore.Context.Database.GetItem returns an object, even if it does not have a version in the current language. Be sure to check that item.Versions has any.

提交回复
热议问题