notes from a passionate developer





This is a personal blog. The opinions expressed here represent my own and not those of my employer, nor current or previous. All content is published "as is", without warranty of any kind and I don't take any responsibility and can't be liable for any claims, damages or other liabilities that might be caused by the content.

Introducing MyCouch - a Simple async CouchDb client for .Net

Just got a new NuGet out – “MyCouch – a Simple async CouchDb client for .Net” – which uses the async HTTP-client to interact with the HTTP API of CouchDb. It tries to mimic the domain-language and structure of CouchDb and lets you work with pure JSON or using entities/POCOs. The future will bring builtin support for caching, proxies/sharding, etc. Go grab it now and try it out. It’s on NuGet. Documentation is improved continuously.

It’s simple to get started with

install-package mycouch
using (var client = new Client(""))
    //Consume here e.g
    var response1 = client.Documents.Post(json);

    //or using the async API
    var response2 = client.Documents.PostAsync(json);

    //Simple get
    var getResponseOfJson = client.Documents.Get("someid");
    var json = getResponseOfJson.Content;

    //or using an entity
    var getResponseOfEntity = client.Documents.Get<MyEntity>("someid");

    //or querying using views
    var viewResponse = client.Views.Query<MyEntity[]>(q => q

    foreach (var myEntity in viewResponse.Rows) {
        //Do something with your entity.

Every action will give you a response in turn. The response gives you information about state etc:

    RequestMethod: GET
    Status: OK(200)
    Reason: <NULL>
    Id: 1
    Rev: 34-e0813c9f99766efcf679468adb02c6ce
    Content: {
        "name":"Fake artist 1",
        "albums":[{"name":"Greatest fakes #1"}]}

Well that’s it for now. More info will come.


View Comments