Hi,

I'm trying out NHibernate with ActiveRecord for the first time, but I
can't seem to get past this exception.

This is my User class:
[ActiveRecord("User")]
    public class User : ActiveRecordBase<User>
    {
        [PrimaryKey]
        public int Id { get; set; }

        [Property]
        public string Name { get; set; }

        [Property]
        public string Email { get; set; }
    }


Initialize:
IConfigurationSource config = ActiveRecordSectionHandler.Instance;
ActiveRecordStarter.Initialize(Assembly.Load("TestApplication"),
config);


And create a new user:
User newUser = new User();
newUser.Id = 1;
newUser.Name = this.textBox1.Text;
newUser.Email = this.textBox2.Text;
newUser.Save();

However, I'm getting this exception:
NHibernate.StaleStateException: Unexpected row count: 0, expected: 1.

Any ideas of what could be wrong?

Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to