Hi, please use NHibernateUtil.AnsiString property

2012/10/30 Prabu W <[email protected]>

> I am mapping the following entity as such:
>
> public class PersonEntity{
>     public virtual string PersonId { get; set; }
>
>     public virtual String Salutation { get; set; }
>     public virtual String FirstName { get; set; }
>     public virtual String LastName { get; set; }
>     public virtual DateTime Birthdate { get; set; }}
> public class PersonMap : ClassMapping<PersonEntity>{
>     public PersonMap()
>     {
>         //ComponentAsId(i => i.Key, map => map.Property(p => p.PersonId, m => 
> m.Type(NHibernateUtil.AnsiString)));
>
>         Id(i => i.PersonId, map => map.Type(???)));
>         Property(i => i.Salutation);
>         Property(i => i.FirstName);
>         Property(i => i.LastName);
>         Property(i => i.Birthdate);
>     }}
>
> As you can see in the commented out code, I can use the NHibernateUtil to
> set the type as AnsiString when using components as an Id. However I cannot
> figure out what to do in plain Id mappings.
>
> I have tried using new NHibernate.Type.AnsiStringType(), but this
> complains about not having no constructors being defined for it.
>
> Any ideas guys?
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nhusers/-/4DEw11B4GxsJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to