2
我正在嘗試向Orchard站點添加小部件,並且我創建了一個從ContentPartRecord繼承的新內容部分。它建立得很好,但是當我去跑Orchard.exe或當我瀏覽到網站,我得到這個錯誤:使用ContentPartRecord導致運行時錯誤
Exception Details: NHibernate.MappingException: Association references unmapped class: System.string
這裏是我的類:
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Records;
using System.Collections.Generic;
namespace Hjn.Models
{
public class PropertySearchRecord : ContentPartRecord
{
public virtual List<string> PropertyTypes { get; set; }
public virtual List<string> Locations { get; set; }
public virtual List<double> MinimumPrices { get; set; }
public virtual List<double> MaximumPrices { get; set; }
}
public class PropertySearchPart : ContentPart<PropertySearchRecord>
{
[Required]
public List<string> PropertyTypes
{
get { return Record.PropertyTypes; }
set { Record.PropertyTypes = value; }
}
[Required]
public List<string> Locations
{
get { return Record.Locations; }
set { Record.Locations = value; }
}
[Required]
public List<double> MinimumPrices
{
get { return Record.MinimumPrices; }
set { Record.MinimumPrices = value; }
}
[Required]
public List<double> MaximumPrices
{
get { return Record.MaximumPrices; }
set { Record.MaximumPrices = value; }
}
}
}
我幾乎失去了與這個。 如果您願意,我也可以發佈堆棧跟蹤。請讓我知道。謝謝!
似乎它是那些令人困惑的列表列。 – 2011-12-30 06:25:54