1
是否有可能通過IUserType映射實體的集合?例如:我可以擁有IUserType實例的集合嗎?
class Foo
{
public int Id { get; set; }
public ISet<Special> Items { get; set; }
}
class Special
{
public Special(string columnValue)
{
_val = columnValue;
}
public override string ToString()
{
return _val.TranformInInterestingWays();
}
private string _val;
}
class SpecialUserTypeForMapping : IUserType
{
// assume that all the right stuff is here
// for using the non-default constructor on the way in
// and calling ToString() on the way out
}
如果我正確地閱讀文檔,無論是<set
>,<one-to-many
>,<many-to-many
>,也不<class
>元素支持 「type」 屬性爲用於IUserType映射應用於<property
>秒。那麼我怎麼去做這件事呢?