2

Hey guys I'm trying to map my property name whose type in my code is String. When I crete the mapping class and try to assign a type to it I use this syntax:

Property(x => x.Name, m => { ... m.Type(new StringType()); ... });

And it's giving me an error, saying that the constructor call isn't valid. But this syntax is valid for all the other types I used (Int32, Boolean and DateTime).

I also tried typing m.Type<string>(); but that ended with an error in the tests I ran.

1
  • String is the default for String properties. Commented Jun 6, 2013 at 22:26

1 Answer 1

3

try this:

using NHibernate;

Property(x => x.Name, map =>
{
    map.Column("SomeColumnName");
    map.Access(Accessor.Property);
    map.Type(NHibernateUtil.String);
    });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.