This project has moved and is read-only. For the latest updates, please go here.

Append ServiceKey

Sep 27, 2013 at 12:56 PM

I would like to expose a set of searches via WCF as an OData service so that it isn't locked into a file, command line, etc. I can access it with multiple tools from multiple platforms, etc. I think I almost have this done, but I need to add [DataServiceKey("....")] to Status, and potentially search. By doing this I should be able to expose the results of the search and work witht the returned JSON/XML/OData from the WCF service. I've posted my provider and svc code on pastebin here :

If it helps for me to post the code here I can, I just wanted to cut down on some clutter. Is there a best practice (reflexil) to modify the search/status class of Linq2Twitter or any suggestion on how/what I'm trying to accomplish? Thanks.
Sep 27, 2013 at 4:04 PM

There are a few options I can think of, some of which may or may not work in your case, but I'll share them just in case:
  1. TwitterContext has a RawResults property that contains the JSON message returned from Twitter. You can use JSON.NET to shape the results or just return the JSON string to your client.
  2. All LINQ to Twitter entities should be XML serializable. The unit tests in the downloadable source code can demonstrate.
  3. You could create your own DTO and move the data over. AutoMapper comes to mind as a useful tool in those scenarios.