c# - illegal access to loading collection -


i know there many answers this.but not getting want missing me.i have tried lot don't find missing.getting 'illegal access loading collection '

even suggesstions wil appricated

nhibernate .hbm

<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping namespace="emsmodels" assembly="emsmodels" xmlns="urn:nhibernate-mapping-2.2">   <class name="reimbursement" table="reimbursement">     <id name="id" column="reimbursementid" type="int">       <generator class="native" />     </id>     <property name="employeeid" type="int" />     <property name="submissiondate" type="datetime" />     <property name="description" type="string" length="500" />      <property name="isactive" type="bool" />     <property name="isdeleted" type="bool" />     <many-to-one name="employee" class="employee" column="employeeid" insert="false" update="false"/>     <bag name="reimbursementdetails"  cascade="all" inverse="true">       <key column="reimbursementid"></key>       <one-to-many class="reimbursementdetails"/>     </bag>   </class> </hibernate-mapping> 

model

public class reimbursement {     public virtual int id { get; set; }     public virtual int employeeid { get; set; }     public virtual datetime submissiondate { get; set; }     public virtual string description { get; set; }     public virtual bool isactive { get; set; }     public virtual bool isdeleted { get; set; }     public virtual employee employee { get; set; }     // public virtual reimbursementdetails reimbursementdetails { get; set; }     public virtual ilist<reimbursementdetails> reimbursementdetails { get; set; }      public virtual string custom_submissiondate     {                 {             datetime date = submissiondate;             return date.tostring("dd-mmm-yyyy");         }     } } 

you have lazy loaded collection in entity, , @ moment @ want load collection, nhibernate session closed.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -