正如问题标题所示,我正在尝试将自定义对象映射到Windows Phone上的db列,我该怎么做?我得到的例外:"无法确定'图层的SQL类型。"
图层是一个自定义对象,存储这个的正确方法是什么,有人可以请我提供一个示例。谢谢
代码:
...
[Table]
public class Product : INotifyPropertyChanged, INotifyPropertyChanging
{
#region ID
//not autogenerated, this is from the client
private String _id;
[Column(IsPrimaryKey = true, IsDbGenerated = false, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public String Id
{
get { return _id; }
set
{
if (_id != value)
{
NotifyPropertyChanging("id");
_id = value;
NotifyPropertyChanged("id");
}
}
}
#endregion
#region Product Layer
private Layer _productlayer;
[Column]
public Layer ProductLayer
{
get { return _productlayer; }
set
{
if (_productlayer != value)
{
NotifyPropertyChanging("ProductLayer");
_productlayer = value;
NotifyPropertyChanged("ProductLayer");
}
}
}
#endregion
...
public class Layer
{
public string name{ get; set; }
public string des { get; set; }
public string pos { get; set; }
}