Auto Mapping -- Id Not Mapped

218 views
Skip to first unread message

Tim Scott

unread,
Sep 7, 2010, 2:31:58 PM9/7/10
to Fluent NHibernate
Auto mapping noob here. I'm getting this error:

The entity 'OrderTicket' doesn't have an Id mapped. Use the Id method
to map your identity property. For example: Id(x => x.Id)

Here's my mapping:

var autoMapping = AutoMap.Assemblies(autoMappingsConfig,
coreAssembly)
.IgnoreBase<BaseEntity>()
.Conventions.AddAssembly(coreAssembly);

OrderTicket derives from the abstract BaseEntity. BaseEntity has the
Id property:

public virtual int Id { get; private set; }

In my auto mapping config file, I have this:

public override bool IsId(Member member)
{
return member.Name == "Id";
}

What am I missing???

James Gregory

unread,
Sep 7, 2010, 3:46:44 PM9/7/10
to fluent-n...@googlegroups.com
What do you see if you debug your config?


--
You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group.
To post to this group, send email to fluent-n...@googlegroups.com.
To unsubscribe from this group, send email to fluent-nhibern...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en.


Tim Scott

unread,
Sep 7, 2010, 4:08:00 PM9/7/10
to Fluent NHibernate
It never calls IsId with a member representing the base Id property.
Is that what you are asking?

TIm
> > fluent-nhibern...@googlegroups.com<fluent-nhibernate%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages