[Mono-aspnet-list] Nhibernate3: Failed to convert parameters
Antoine Cailliau
antoinecailliau at gmail.com
Thu Feb 17 09:02:23 EST 2011
Dear all,
(I'm not sure the error is due to NHibernate and not to mono. This cause
double posting: here and on nhibernate forum.)
I setup a small web application to test nHibernate with mono and
postgresql.
I'm facing a problem I can't find a solution. Nhibernate throws an
"ArgumentException" with message "failed to convert parameters".
Here is the stack trace:
System.ArgumentException: failed to convert parameters
at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x00000] in <filename unknown>:0
at System.Reflection.MonoProperty.SetValue (System.Object obj,
System.Object value, BindingFlags invokeAttr, System.Reflection.Binder
binder, System.Object[] index, System.Globalization.CultureInfo culture)
[0x00000] in <filename unknown>:0
at System.Reflection.PropertyInfo.SetValue (System.Object obj,
System.Object value, System.Object[] index) [0x00000] in <filename
unknown>:0
at NHibernate.Properties.BasicPropertyAccessor+BasicSetter.Set
(System.Object target, System.Object value) [0x00000] in <filename
unknown>:0
My project is a very simple ASP.NET MVC. The error shows up when I do
session.save:
Product p = new Product { Name = "Cool", Id = 0 };
session.Save(p);
tx.Commit();
Product is defined as:
public class Product
{
public virtual int Id { get ; set ; }
public virtual string Name { get ; set ; }
}
With the mapping
<class name="Product">
<id name="Id">
<generator class="counter" />
</id>
<property name="Name" />
</class>
The table is correctly created.
create table Product (
Id int4 not null,
Name varchar(255),
primary key (Id)
)
Any idea on why I'm getting this error?
Thanks in advance for your help !
Antoine
--
Antoine Cailliau
More information about the Mono-aspnet-list
mailing list