私のモデルの内部には、attributes
その値がデータベースから取得されたという属性がありますcutomized_attributes
。プロパティはデータベースにattributes
存在しないため、計算されたばかりの値ですが、次のことをしようとしているときに、このエラーに直面しています:
エラー: System.Data.Entity.Edm.EdmEntityType: : EntityType 'JToken' にキーが定義されていません。この EntityType のキーを定義します
モデル:
public class Restaurant
{
public int id{ get; set; }
public string name{ get; set; }
public string cutomized_attributes { get; set; }
private JObject _attributes { get; set; }
public JObject attributes
{
get
{
if (this._attributes == null)
return this._attributes = RestaurantAttributes.parseAttrString(this.cutomized_attributes);
return this._attributes;
}
set
{
this._attributes = value;
}
}
}