Mapping By Code and Subselect

16 views
Skip to first unread message

Ricardo Peres

unread,
Apr 5, 2011, 9:43:26 AM4/5/11
to nhusers
Hello,

Does the new mapping by code work with the also new <subselect/>
feature?
I'm asking this because I can't get it to work, although it doesn't
throw any exception. Also, I can't find a way to specify the
<synchronize/> element. It does work well with XML configuration,
though.
Here's my code:

mapper.Class<OrderCustomer>(ca =>
{
ca.Mutable(false);
ca.Subselect("SELECT [order].id AS orderid, [order].date AS
orderdate, customer.name AS customername FROM [order] INNER JOIN
customer ON customer.id = [order].customerid");
ca.Id(x => x.OrderId, map =>
{
map.Column("`ORDERID`");
map.Generator(Generators.Assigned);
});
ca.Property(x => x.CustomerName, x =>
{
x.Column("`CUSTOMERNAME`");
x.Update(false);
});
ca.Property(x => x.OrderDate, x =>
{
x.Column("`ORDERDATE`");
x.Update(false);
});
});

Fabio, any ideas? Perhaps I should wait some more days...?

Thanks, once again!

RP

Fabio Maulo

unread,
Apr 5, 2011, 1:24:03 PM4/5/11
to nhu...@googlegroups.com
perhaps


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




--
Fabio Maulo

Reply all
Reply to author
Forward
0 new messages