It took a bit of tweaking, but I got my one-to-one mapping working
with ConventionModelMapper. The result is something like this:

        var mapper = new ConventionModelMapper();

        mapper.Class<Operation>(map =>
                                {
                        map.OneToOne(x => x.Data, m =>
                                        {
                                                m.Constrained(false);
        
m.PropertyReference(typeof(OperationData).GetProperties().FirstOrDefault(p
=> p.Name == "Operation"));
                                        });
                                });

        mapper.Class<OperationData>(map => map.ManyToOne(x => x.Operation, m
=>
                                {
                        m.Unique(true);                                         
                        m.NotNullable(true);
                                }));

Question 1: is there a less ugly way to map the PropertyReference
attribute? Some helper method, perhaps?
Question 2: could an overload be added that takes an expression?

Thanks!!
-Michael

-- 
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