jjzjj

PersistentGenericSet

全部标签

C# - NHibernate 无法将 NHibernate.Collection.Generic.PersistentGenericSet 转换为 System.Collections.Generic.IList

出于某种原因,NHibernate告诉我它无法将NHibernate.Collection.Generic.PersistentGenericSet[Ingredient]转换为System.Collection.Generic.IList[Ingredient],当我尝试从数据库中获取数据时。这是我的类映射/实现的简化版本:publicclassProduct{protectedProduct(){};publicvirtualName{get;set;}publicvirtualIList{get{returnnewList(ingredients).AsReadOnly();}p

c# - 获取 "unable to cast PersistentGenericSet to ISet"错误

我收到这个错误:Unabletocastobjectoftype'NHibernate.Collection.Generic.PersistentGenericSet1[IocWinFormTestEntities.People]'totype'System.Collections.Generic.ISet1[IocWinFormTestEntities.People]'.实体:publicclassEvent{publicEvent(){this.People=newHashSet();}publicvirtualGuidId{get;privateset;}publicvirtua

c# - 获取 "unable to cast PersistentGenericSet to ISet"错误

我收到这个错误:Unabletocastobjectoftype'NHibernate.Collection.Generic.PersistentGenericSet1[IocWinFormTestEntities.People]'totype'System.Collections.Generic.ISet1[IocWinFormTestEntities.People]'.实体:publicclassEvent{publicEvent(){this.People=newHashSet();}publicvirtualGuidId{get;privateset;}publicvirtua