Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-74

Main .NET page documentation might be incorrect?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.1.6
    • Fix Version/s: 1.2.0
    • Component/s: docs
    • Labels:
      None

      Description

      This page: http://www.couchbase.com/develop/net/current

      When reading this example under "Single Value Results":
      var bar = client.Get("foo") as string;
      bar = "bar";
      var result = client.Store(StoreMode.Set, "foo", bar);
      if (result)

      { Console.WriteLine("Store operation was successful"); }

      It seems that the very first "var bar..." should actually be something different since "bar" gets overwritten with the next line?

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        john John Zablocki (Inactive) added a comment -

        This was contrived, but intentional. I'm trying to draw a distinction between the Cas operation in the section that follows in the docs.
        Admittedly, the example falls apart a little with a simple string. I was imagining the scenario when you get a complex type var beer = client.Get<Beer>("foo"); and you change a single property on the object and resave it. If it's confusing, I can change it.

        var result = client.GetWithCas("foo");
        var bar = "bar";
        var result = client.Cas(StoreMode.Set, "foo", bar, result.Cas);
        if (result.Result)

        { Console.WriteLine("Cas operation was successful"); }
        Show
        john John Zablocki (Inactive) added a comment - This was contrived, but intentional. I'm trying to draw a distinction between the Cas operation in the section that follows in the docs. Admittedly, the example falls apart a little with a simple string. I was imagining the scenario when you get a complex type var beer = client.Get<Beer>("foo"); and you change a single property on the object and resave it. If it's confusing, I can change it. var result = client.GetWithCas("foo"); var bar = "bar"; var result = client.Cas(StoreMode.Set, "foo", bar, result.Cas); if (result.Result) { Console.WriteLine("Cas operation was successful"); }
        Hide
        perry Perry Krug added a comment -

        I think that makes more sense given what you're actually showing, although your higher-level example makes a lot more sense for the usage of CAS and might be worth building up a bit.

        Show
        perry Perry Krug added a comment - I think that makes more sense given what you're actually showing, although your higher-level example makes a lot more sense for the usage of CAS and might be worth building up a bit.
        Hide
        john John Zablocki (Inactive) added a comment -

        The getting started guide has been rewritten for 1.2 and will replace this older version on launch.

        Show
        john John Zablocki (Inactive) added a comment - The getting started guide has been rewritten for 1.2 and will replace this older version on launch.

          People

          • Assignee:
            john John Zablocki (Inactive)
            Reporter:
            perry Perry Krug
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes