LinFu proxy cannot be created on an entity that has a method with out parameter "public virtual int DoStuff(out string answer)"

Description

Entity with a method with an out parameter, cannot be proxied.

Also, the exception doesn't give good information:

outer:
NHibernate.HibernateException: Creating a proxy instance failed

inner:
System.ArgumentNullException: Value cannot be null.Parameter name: type

The below code is the failing example. Removing the out parameter makes it work

father entity:

public class Department
{
public virtual int Id { get; set; }
public virtual IDictionary<int,Employee> Employees {get;set;}

public virtual void OutParametersMethod(out string outString)
{
outString = "";
}
}

the child:

public class Employee
{
public virtual int Id { get; set; }

public virtual Department Department { get; set; }
}

The mapping of the many to one (in Employee.hbm.xml) (is trivial):

<many-to-one name="Department" class="TestVSOracle.Entities.Department, TestVSOracle"
column="DEPARTMENT_ID" not-null="false" lazy="proxy"/>

Environment

None

Activity

Show:

Richard Brown May 27, 2010 at 4:49 AM

Closed. Thanks for the investigation Julian.

ns May 18, 2010 at 1:13 PM

ok close it

Julian Maughan May 18, 2010 at 9:39 AM

This is a reported bug in Lin Fu (see http://code.google.com/p/linfu/issues/detail?id=20). Not sure if it has been resolved. Fortunately NHibernate can use various proxy factories, so you could try Castle or Spring - maybe they don't have this same limitation.

So can this be closed?

External Issue

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created May 7, 2010 at 12:23 PM
Updated May 27, 2010 at 4:49 AM
Resolved May 27, 2010 at 4:49 AM
Who's Looking?