Skip to content

Commit

Permalink
Fix line endings in Program.cs for example and update it to point to …
Browse files Browse the repository at this point in the history
…db014

Update LiteCore to get testing fix
  • Loading branch information
borrrden committed Aug 7, 2017
1 parent 9a31ef6 commit c7d7fc5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions docs/examples/api-walkthrough/api-walkthrough/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ static void Main(string[] args)
Couchbase.Lite.Support.NetDesktop.Activate();

// create database
var config = new DatabaseConfiguration();
config.ConflictResolver = new ExampleConflictResolver();
var database = new Database("my-database", config);
var config = new DatabaseConfiguration();
config.ConflictResolver = new ExampleConflictResolver();
var database = new Database("my-database", config);

// create document
var newTask = new Document();
Expand Down Expand Up @@ -122,24 +122,24 @@ static void Main(string[] args)
Console.WriteLine($"document properties {JsonConvert.SerializeObject(doc.ToDictionary(), Formatting.Indented)}");
}

// create conflict
/*
* 1. Create a document twice with the same ID (the document will have two conflicting revisions).
* 2. Upon saving the second revision, the ExampleConflictResolver's resolve method is called.
* The `theirs` ReadOnlyDocument in the conflict resolver represents the current rev and `mine` is what's being saved.
* 3. Read the document after the second save operation and verify its property is as expected.
* The conflict resolver will have deleted the obsolete revision.
*/
var theirs = new Document("buzz");
theirs.Set("status", "theirs");
var mine = new Document("buzz");
mine.Set("status", "mine");
database.Save(theirs);
database.Save(mine);

var conflictResolverResult = database.GetDocument("buzz");
Console.WriteLine($"conflictResolverResult doc.status ::: {conflictResolverResult.GetString("status")}");

// create conflict
/*
* 1. Create a document twice with the same ID (the document will have two conflicting revisions).
* 2. Upon saving the second revision, the ExampleConflictResolver's resolve method is called.
* The `theirs` ReadOnlyDocument in the conflict resolver represents the current rev and `mine` is what's being saved.
* 3. Read the document after the second save operation and verify its property is as expected.
* The conflict resolver will have deleted the obsolete revision.
*/
var theirs = new Document("buzz");
theirs.Set("status", "theirs");
var mine = new Document("buzz");
mine.Set("status", "mine");
database.Save(theirs);
database.Save(mine);

var conflictResolverResult = database.GetDocument("buzz");
Console.WriteLine($"conflictResolverResult doc.status ::: {conflictResolverResult.GetString("status")}");

// replication (Note: Linux / Mac requires .NET Core 2.0+ due to
// https://github.com/dotnet/corefx/issues/8768)
/*
Expand All @@ -160,8 +160,8 @@ static void Main(string[] args)
}
*/
var url = new Uri("blip://localhost:4984/db");
var replConfig = new ReplicatorConfiguration(database, url);
var replication = new Replicator(replConfig);
var replConfig = new ReplicatorConfiguration(database, url);
var replication = new Replicator(replConfig);
replication.Start();

// replication change listener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Couchbase.Lite" Version="2.0.0-db013" />
<PackageReference Include="Couchbase.Lite" Version="2.0.0-db014" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion vendor/couchbase-lite-core

0 comments on commit c7d7fc5

Please sign in to comment.