User:Svick/LinqToWiki

LinqToWiki is a library for accessing MediaWiki wikis (including Wikipedia) through the API from .Net languages like C# and VB.NET.

It can be used to do almost anything that can be done from the web interface and more, including things like editing articles, listing articles in categories, listing all kinds of links on a page and much more. Querying the various lists available can be done using LINQ queries, which then get translated into efficient API requests.

The library is strongly-typed, which means it should be hard to make invalid requests and it also makes it easy to discover available methods and properties though IntelliSense.

Downloads
LinqToWiki is always customized for a specific wiki.

English Wikipedia

 * Add the package LinqToWiki to your project through NuGet; or
 * Download LinqToWiki (17 February 2013)

Other wikis
In this case, you have several options:


 * 1) Use the English Wikipedia build and hope you don't encounter any significant differences between the two wikis in your queries.
 * 2) Request a build for your wiki on |the talk page.
 * 3) Create a custom build yourself.

Usage
For example, to edit the Sandbox anonymously, you can use the following:

As you can see, in methods like this, you should use named parameters, because the  method has lots of them, and you probably don't need them all.

The code looks more convoluted than necessary (can't the library get the token for me?), but that's because it's all generated automatically.

For more complex examples, have a look at the documentation on the project's site.