R – subsonic 3 alpha + ado.net data services any samples

subsonicwcf-data-services

There are a couple of resources on the Internet describing preview 2 of subsonic with Astoria :

http://theruntime.com/blogs/jaykimble/archive/2008/11/18/quotsubsonicquot-for-services-found-subsonic-3–ado.net-data-services.aspx

and working sample at

http://code.msdn.microsoft.com/SubSonicForADONETDS

I applied all respective changes to subsonic tt(s) , however didn't manage to make MSDN project work.
After eliminating :

a) Astoria didn't like
private DB() { } in QuerySurface.tt , so I blindly made constructor public

b) Not sure how to generate compound primary key

<# if(EnableForUseWIthAstoria) {
#> [System.Data.Services.Common.DataServiceKey("<#=pk#>")] <# }#> 

results in

[System.Data.Services.Common.DataServiceKey("")] 

instead of

[System.Data.Services.Common.DataServiceKey("OrderID", "ProductID")] 

so just excluded the table.

The current obstacle

        var q = from cust in ctx.Customers
                where cust.CustomerID == "ROMEY"
                select cust;

        Customers c = q.First();

results in exception:
Resource not found for the segment 'Customers'

Has anyone tried that or knows another the latest and greatest sample existence ?

Best Answer

See this issue for a demo template for data services:

http://code.google.com/p/subsonicthree/issues/detail?id=53

Related Topic