views:

20

answers:

1

This code fails to compile with the error 'NHibernate.Mapping.Property' is not an attribute class. Any ideas why?

using System;
using System.Linq;
using DevExpress.Xpo;
using System.Collections.Generic;
using System.Text;
using NHibernate.Mapping;

namespace Test {

  public class User : IdentityItem {

    public string email;
    public string password;
    public string displayname;

    [NHibernate.Mapping.Property(IsLazy = true, IsOptional = true, Name = "admin_notes")]
    public string admin_notes { get; set; }

  }
}

Thanks in advance :-)

+2  A: 

It's because 'NHibernate.Mapping.Property' is not an attribute class.

Use 'NHibernate.Mapping.Attributes.Property' instead.

Pierre 303
or change/add using NHibernate.Mapping.Attributes.Property and just use [Property(IsLaz...
Antony Koch
is there a way to do this with NH3?
Ben Herila
I think yes. I've not tested it, but I see no reason why it would not work
Pierre 303