Skip to content

Commit

Permalink
Mods to Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xivSolutions committed Dec 21, 2014
1 parent b3636d6 commit bc1a6bb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
11 changes: 11 additions & 0 deletions Demo/Postgres/pgRelationalDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ public void Run() {
Console.WriteLine("{0} Albums", _testDb.Albums.Count);
Console.WriteLine("{0} Tracks", _testDb.Tracks.Count);

Console.WriteLine("Update a whole bunch of artist records...");
var updateArtists = _testDb.Artists.ToList();
foreach (var artist in updateArtists) {
artist.Name = "Updated Artist " + artist.ArtistId;
}
sw.Reset();
sw.Start();
_testDb.Artists.Update(updateArtists);
sw.Stop();
Console.WriteLine("Updated {0} artist records in {1} ms", updateArtists.Count, sw.ElapsedMilliseconds);

Console.WriteLine("");
Console.WriteLine("Postgres Relational Demo - CHINOOK DATA");
Console.WriteLine("=======================================");
Expand Down
18 changes: 9 additions & 9 deletions Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ internal class Program {
private static void Main(string[] args) {
//// POSTGRES DEMOS: +++++++++++++++++++++++++++++++++++++++++++++++++++++

//pgRelationalDemo _pgRelationalDemo = new pgRelationalDemo();
//pgDocumentDemo _pgDocumentDemo = new pgDocumentDemo();

//_pgRelationalDemo.Run();
//Console.WriteLine("");
pgRelationalDemo _pgRelationalDemo = new pgRelationalDemo();
_pgRelationalDemo.Run();
Console.WriteLine("");

//pgDocumentDemo _pgDocumentDemo = new pgDocumentDemo();
//_pgDocumentDemo.Run();
//Console.WriteLine("");

//// SQL LITE DEMOS: ++++++++++++++++++++++++++++++++++++++++++++++++++++++

//sqliteRelationalDemo _sqliteRelationalDemo = new sqliteRelationalDemo();
sqliteDocumentDemo _sqliteDocumentDemo = new sqliteDocumentDemo();

//sqliteRelationalDemo _sqliteRelationalDemo = new sqliteRelationalDemo();
//_sqliteRelationalDemo.Run();
//Console.WriteLine("");

_sqliteDocumentDemo.Run();
//sqliteDocumentDemo _sqliteDocumentDemo = new sqliteDocumentDemo();
//_sqliteDocumentDemo.Run();
//Console.WriteLine("");

// JSON DEMOS: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//jsonPocoDemo _jsonPocoDemo = new jsonPocoDemo();
//jsonDocumentDemo _jsonDocumentDemo = new jsonDocumentDemo();

//jsonPocoDemo _jsonPocoDemo = new jsonPocoDemo();
//_jsonPocoDemo.Run();
//Console.WriteLine("");

//jsonDocumentDemo _jsonDocumentDemo = new jsonDocumentDemo();
//_jsonDocumentDemo.Run();
//Console.WriteLine("");

Expand Down
20 changes: 10 additions & 10 deletions Demo/Sqlite/sqliteRelationalDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ public void Run() {
Console.WriteLine("");
Console.WriteLine("Re-Initialize Db and read all that data from back-end...");
Console.WriteLine("");
Console.WriteLine("Update a whole bunch of artist records...");

sw.Reset();
sw.Start();
_testDb.LoadData();
sw.Stop();
Console.WriteLine("Read all data from store in {0} ms", sw.ElapsedMilliseconds);
Console.WriteLine("{0} Artists", _testDb.Artists.Count);
Console.WriteLine("{0} Albums", _testDb.Albums.Count);
Console.WriteLine("{0} Tracks", _testDb.Tracks.Count);

Console.WriteLine("Update a whole bunch of artist records...");
var updateArtists = _testDb.Artists.ToList();
foreach (var artist in updateArtists) {
artist.Name = "Updated Artist " + artist.ArtistId;
Expand All @@ -59,15 +68,6 @@ public void Run() {
sw.Stop();
Console.WriteLine("Updated {0} artist records in {1} ms", updateArtists.Count, sw.ElapsedMilliseconds);

sw.Reset();
sw.Start();
_testDb.LoadData();
sw.Stop();
Console.WriteLine("Read all data from store in {0} ms", sw.ElapsedMilliseconds);
Console.WriteLine("{0} Artists", _testDb.Artists.Count);
Console.WriteLine("{0} Albums", _testDb.Albums.Count);
Console.WriteLine("{0} Tracks", _testDb.Tracks.Count);

Console.WriteLine("");
Console.WriteLine("SQLite Relational Demo - CHINOOK DATA");
Console.WriteLine("=======================================");
Expand Down

0 comments on commit bc1a6bb

Please sign in to comment.