2017-05-24 95 views
0

我們最近將項目升級爲在Sitecore 8.2,Rev3上運行,作爲升級的一部分,我們必須更新現在在4.3.4.197版本上運行的Glass Mapper。Sitecore 8.2 Glass Mapper創建項目錯誤

然而,我們現在越來越試圖創建一個項目時的錯誤:

  var service = new SitecoreService(_database); 
      service.Create(parent, redHotDeal); 

我們得到唯一的例外是: 無法找到父項目類型Sitecore.Data.Items.Item配置

堆棧跟蹤:

在Glass.Mapper.Sc.SitecoreService.Create [T,TK](TK父,T的newitem,布爾updateStatistics,布爾無聲)在C:\ TeamCity的\ buildAgent \工作\ 8567e2ba106d3992 \ Source \ Glass.Mapper.Sc \ SitecoreService.cs:第200行 位於G:\ TFSProjects \ IV \ Source中的TTC.IV.Infrastructure.Import.RedHotDeals.RedHotDealsImporter.ImportRedHotDeals(IEnumerable`1 redhotdeals,Item parent) \ TTC.IV.Infrastructure \ Import \ RedHotDeals \ RedHotDealsImporter.cs:104行

有沒有人遇到過這個問題或者知道可能是什麼原因造成的?在設置

多一點信息: 父項的類型Sitecore.Data.Items.Item redHotDeal項目的類型DealCollectionItem的

DealCollectionItem模式是這樣的:

使用系統; using Glass.Mapper.Sc.Configuration.Attributes;

namespace TTC.IV.Model.Templates.Items 
{ 
    [SitecoreType(TemplateId = TemplateStringId)] 
    public class DealCollectionItem : Item 
    { 
     public new static Guid TemplateId = new Guid(TemplateStringId); 
     private const string TemplateStringId = "{998CA212-92D5-4566-B877-44D1F378EFD6}"; 

    /// <summary> 
    /// Gets or sets the mv code. 
    /// </summary> 
    /// <value> 
    /// The mv code. 
    /// </value> 
    [SitecoreField] 
    public virtual string MvCode { get; set; } 

    /// <summary> 
    /// Gets or sets the departure code. 
    /// </summary> 
    /// <value> 
    /// The departure code. 
    /// </value> 
    [SitecoreField] 
    public virtual string DepartureCode { get; set; } 

    /// <summary> 
    /// Gets or sets the discount. 
    /// </summary> 
    /// <value> 
    /// The discount. 
    /// </value> 
    [SitecoreField] 
    public virtual double Discount { get; set; } 

    /// <summary> 
    /// Gets or sets the promo code. 
    /// </summary> 
    /// <value> 
    /// The promo code. 
    /// </value> 
    [SitecoreField] 
    public virtual string PromoCode { get; set; } 

    /// <summary> 
    /// Gets or sets the price. 
    /// </summary> 
    /// <value> 
    /// The price. 
    /// </value> 
    [SitecoreField] 
    public virtual double Price { get; set; } 

    /// <summary> 
    /// Gets or sets the promo amount. 
    /// </summary> 
    /// <value> 
    /// The promo amount. 
    /// </value> 
    [SitecoreField] 
    public virtual double PromoAmount { get; set; } 

    /// <summary> 
    /// Gets or sets the table amount. 
    /// </summary> 
    /// <value> 
    /// The table amount. 
    /// </value> 
    [SitecoreField] 
    public virtual int TableAmount { get; set; } 

    /// <summary> 
    /// Gets or sets the import region. 
    /// </summary> 
    /// <value> 
    /// The import region. 
    /// </value> 
    public string ImportRegion { get; set; } 
} 

}

回答

相關問題