Id Convention
Hello, I have a question regarding conventions.
I want to be able to do something like this :
public class IdConvention : IIdConvention
{
public void Apply(IIdentityInstance instance)
{
instance.GeneratedBy.Assigned()
}
}
, and in the mapping class not to specify : Id(x=x.Id). But if I
don't specify the mapping for Id the Fluent Nhibernate throws an
exception saying the Id is not mapped.
I don't see the sense to map the Id because I have create a
convention for it.
I'm doing something wrong or I'm missing something?
Thank you
Andrei
Support Staff 2 Posted by Paul Batum on 07 Aug, 2010 12:32 AM
Currently, the only supported way for you to be able to avoid having to type
"Id(x => x.Id)" is to use automapping. Automapping will reflect on your
classes and build the mappings for you. Your convention will also be
applied.
I think James is doing some experimental work on bring fluent mapping and
automapping closer together that could help in this scenario but I do not
know how far along the work is.
On Tue, Jul 27, 2010 at 7:11 PM, Andrei <
tender+d708d292c54fba3b80ffb21d31aa7eb20cc9f540e@tenderapp.com<tender%2Bd708d292c54fba3b80ffb21d31aa7eb20cc9f540e@tenderapp.com>
> wrote: