Linq to NPersist to MS Access

I’ve finally seen my own Linq support Live :-P
Untill now I’ve only been emitting NPath quereis and verified that NPath is correct.

The reason I havent tested it live untill now is that I only have my gaming machine to develop on atm. the dev machine is dead.

Anyway, I’m trying it against NWind MS Access DB right now and it works like a charm.
I can even run fairly complex queries, even if it takes a bit of time on MS Access.

var res = from cust in ctx.Repository<Customer>()
          where
          cust.Orders.Any(
                 order => order.OrderDetails.Sum(
                     detail => detail.UnitPrice * detail.Quantity
                                                ) > 1000)
          orderby cust.CompanyName
          select cust;

This lists all customers that have atleast one order with the order total of 1000$.
I was a bit nervous before and thought that maybe it will fail.. even though the NPath looks correct and the NPath to SQL generator have been working fine for the last 3 years ;-)

Advertisement

One Response to Linq to NPersist to MS Access

  1. farvish says:

    Very nice post. Sometime due to lost conenction our database get corrupted and compact and rwpair doesn’t help us. Even estabalishing connection with some other database make this type of error in this scenario we can use SPAMSPAM software to SPAMSPAM.

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.