query customizations in Astoria?

Hi,

I am trying to think of ways in which Astoria can be used to query spatial databases. Can Astoria URL query contain parameters that can be parsed into custom objects by user functions that can then be used to query a spatial database? I.E. for example, the URL contains a series of X Ys that can then be parsed to custom line objects that will be used for querying.

Thank You,

Vish

[425 byte] By [viswaug] at [2008-2-10]
# 1

The CTP exposes custom logic on a data service as a service operation. Below is a description of service ops and and example of how to write one using the Astoria CTP:

In order to address the need to run custom logic on the data service, Astoria supports service operations. Data service operations are an extension to the Windows Communication Foundation (WCF) infrastructure; WCF allows developers to expose .NET methods as service operations using both SOAP and REST style interfaces. The Astoria extensions work in conjunction with the rest of the Astoria service to maintain the flexibility of the data service even when using methods.

The example below shows a service operation that lists customers for a given city:

public class Northwind : WebDataService<NorthwindEntities>

{

[WebGet]

public static ObjectQuery<Customer> CustomersByCity(NorthwindEntities nw,

string city)

{

if(string.IsNullOrEmpty(city)) {

throw new ArgumentNullException("city",

"You must provide a city name argument");

}

return nw.Customers.Where("it.City = @city",

new ObjectParameter("city", city));

}

}

To invoke the service operation, the usual URL format is used, with query string parameters mapped directly to the method arguments. For example, http://host/vdir/northwind.svc/CustomersByCity?city=London

We are still actively designing this area of Astoria so any feedback or use cases you have are much appreciated!

MikeFlasko at 2007-10-2 > top of Msdn Tech,Incubation Technologies,Project Codename: Astoria...
# 2

Hi Mike,

Can you tell me a bit more about the "NorthwindEntities" class used above. Is it a class that is generated and used by the Astoria Framework? If not how should be generated or referenced?

Thank You,

Vish

viswaug at 2007-10-2 > top of Msdn Tech,Incubation Technologies,Project Codename: Astoria...