Skip to content

Commit

Permalink
version 2.2.0 + fixed nuget references
Browse files Browse the repository at this point in the history
  • Loading branch information
scale-tone committed Feb 12, 2017
1 parent 481e747 commit 7519393
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 24 deletions.
7 changes: 3 additions & 4 deletions Sources/Linq2DynamoDb.AspNet.DataSource/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
"description": "A set of extensions to Linq2DynamoDb.DataContext for use in ASP.Net projects. Includes an ASP.Net DataSource implementation. Extends Linq2DynamoDb.DataContext to allow exposing it as an OData endpoint.",
"copyright": "Copyright © 2017",
"authors": [ "linq2dynamodb" ],
"version": "2.1.0-*",
"version": "2.2.0-*",
"packOptions": {
"owners": [ "linq2dynamodb" ],
"projectUrl": "https://github.com/scale-tone/linq2dynamodb/",
"repository": { "url": "https://github.com/scale-tone/linq2dynamodb/" },
"summary": "A set of extensions to Linq2DynamoDb.DataContext for use in ASP.Net projects. Includes an ASP.Net DataSource implementation. Extends Linq2DynamoDb.DataContext to allow exposing it as an OData endpoint.",
"releaseNotes": "",
"releaseNotes": "Fixed nuget references.",
"tags": [ "Linq2DynamoDb", "AWS", "DynamoDb", "context", "caching", "LINQ", "ASP.NET", "DataSource", "OData" ]
},
"dependencies": {
"AWSSDK.DynamoDBv2": "3.3.2.1",
"Linq2DynamoDb.DataContext": "2.1.0-*",
"NETStandard.Library": "1.6.1"
"Linq2DynamoDb.DataContext": "2.2.0-*"
},
"frameworks": {
"net462": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
"description": "Implements caching in MemcacheD (including AWS ElastiCache implementation) for Linq2DynamoDb.DataContext.",
"copyright": "Copyright © 2017",
"authors": [ "linq2dynamodb" ],
"version": "2.1.0-*",
"version": "2.2.0-*",
"packOptions": {
"owners": [ "linq2dynamodb" ],
"projectUrl": "https://github.com/scale-tone/linq2dynamodb/",
"repository": { "url": "https://github.com/scale-tone/linq2dynamodb/" },
"summary": "Implements caching in MemcacheD for Linq2DynamoDb.DataContext.",
"releaseNotes": "",
"releaseNotes": "Fixed nuget references.",
"tags": [ "Linq2DynamoDb", "AWS", "DynamoDb", "caching", "memcached", "enyim" ]
},
"dependencies": {
"EnyimMemcached": "2.16.0",
"Linq2DynamoDb.DataContext": "2.1.0-*",
"NETStandard.Library": "1.6.1"
"Linq2DynamoDb.DataContext": "2.2.0-*"
},
"frameworks": {
"net462": {
Expand Down
8 changes: 4 additions & 4 deletions Sources/Linq2DynamoDb.DataContext.Caching.Redis/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
"description": "Implements caching in Redis (including AWS ElastiCache implementation) for Linq2DynamoDb.DataContext.",
"copyright": "Copyright © 2017",
"authors": [ "linq2dynamodb" ],
"version": "2.1.0-*",
"version": "2.2.0-*",
"packOptions": {
"owners": [ "linq2dynamodb" ],
"projectUrl": "https://github.com/scale-tone/linq2dynamodb/",
"repository": { "url": "https://github.com/scale-tone/linq2dynamodb/" },
"summary": "Implements caching in Redis for Linq2DynamoDb.DataContext.",
"releaseNotes": "Migrated to .Net Standard 1.6",
"releaseNotes": "Fixed nuget references.",
"tags": [ "Linq2DynamoDb", "AWS", "DynamoDb", "caching", "Redis" ]
},
"dependencies": {
"Linq2DynamoDb.DataContext": "2.1.0-*",
"NETStandard.Library": "1.6.1",
"Linq2DynamoDb.DataContext": "2.2.0-*",
"StackExchange.Redis": "1.2.0"
},
"frameworks": {
Expand All @@ -26,6 +25,7 @@
"netstandard1.6": {
"imports": "dnxcore50",
"dependencies": {
"NETStandard.Library": "1.6.1",
"Newtonsoft.Json": "9.0.1"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void DataContext_HashKeyTable_BatchGetOperationIsUsed()
this._batchGetUsed = false;

// then from cache
var result2 = this.HashKeyTable.Where(b => hashKeys.Contains(b.Name)).ToDictionary(b => b.Name);
var result2 = this.HashKeyTable.Where(b => hashKeys.Contains(b.Name)).ToListAsync().Result.ToDictionary(b => b.Name);

Assert.IsFalse(this._batchGetUsed);
Assert.AreEqual(1, this._cacheHitCount);
Expand All @@ -160,7 +160,7 @@ public void DataContext_HashAndRangeKeyTable_BatchGetOperationIsUsed()
var rangeKeys = new List<string> { "C# for Dummies", "TurboPascal for Dummies" };

// first from table
var result1 = this.HashAndRangeKeyTable.Where(b => b.Author == hashKey && rangeKeys.Contains(b.Name)).ToDictionary(b => b.Name);
var result1 = this.HashAndRangeKeyTable.Where(b => b.Author == hashKey && rangeKeys.Contains(b.Name)).ToListAsync().Result.ToDictionary(b => b.Name);

Assert.IsTrue(this._batchGetUsed);
this._batchGetUsed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public void DataContext_Find_ReturnsExistingRecordWhenUsedWithHashAndRangeKeys()

Assert.AreEqual(book.Name, storedBook.Name, "Book with wrong name was returned");
Assert.AreEqual(book.PublishYear, storedBook.PublishYear, "Book with wrong publishYear was returned");

var storedBook2 = bookTable.FindAsync(book.Name, book.PublishYear).Result;

Assert.AreEqual(book.Name, storedBook2.Name, "Book with wrong name was returned");
Assert.AreEqual(book.PublishYear, storedBook2.PublishYear, "Book with wrong publishYear was returned");
}

[Test]
Expand All @@ -34,6 +39,15 @@ public void DataContext_Find_ThrowsExceptionWhenRecordDoesNotExist()
bookTable.Find(Guid.NewGuid().ToString(), 0);
}


[Test]
[ExpectedException(typeof(AggregateException))]
public void DataContext_FindAsync_ThrowsExceptionWhenRecordDoesNotExist()
{
var bookTable = Context.GetTable<Book>();
bookTable.FindAsync(Guid.NewGuid().ToString(), 0).Wait();
}

[Test]
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "has 2 key fields, but 1 key values was provided", MatchType = MessageMatch.Contains)]
public void DataContext_Find_ThrowsExceptionIfUserDoesNotProvideRangeKeyInHashRangeTables()
Expand Down Expand Up @@ -346,9 +360,13 @@ public void DateContext_Query_CountFunctionReturnsCorrectNumberOfRecordsOnSmallD
var numberOfRecordsInDb = Context.GetTable<Book>().Count(book => book.Name == bookRev1.Name);

Assert.AreEqual(DataSetLength, numberOfRecordsInDb);
}

[Test]

numberOfRecordsInDb = Context.GetTable<Book>().ToListAsync().Result.Count(book => book.Name == bookRev1.Name);

Assert.AreEqual(DataSetLength, numberOfRecordsInDb);
}

[Test]
public void DateContext_Query_LongCountFunctionReturnsCorrectNumberOfRecordsOnSmallDataSets()
{
const int DataSetLength = 20;
Expand Down Expand Up @@ -382,6 +400,10 @@ public void DateContext_RetrievesManyRecords()

var allBooks = Context.GetTable<Book>().Where(book => book.Name == bookRev1.Name).ToList();
Assert.AreEqual(DataSetLength, allBooks.Count);

var query = from b in Context.GetTable<Book>() where b.Name == bookRev1.Name select b;
allBooks = query.ToListAsync().Result;
Assert.AreEqual(DataSetLength, allBooks.Count);
}

// ReSharper restore InconsistentNaming
Expand Down
16 changes: 9 additions & 7 deletions Sources/Linq2DynamoDb.DataContext/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
"description": "A type-safe data context for AWS DynamoDB with LINQ and in-memory caching support. Allows to combine DynamoDB's durability with cache speed and read consistency. Translates LINQ queries into corresponding DynamoDB Get/Query/Scan operations (trying to choose the most effective one) and stores query results in an in-memory cache. When data is modified, it's saved both to DynamoDB and to cache.",
"copyright": "Copyright © 2017",
"authors": [ "linq2dynamodb" ],
"version": "2.1.0-*",
"version": "2.2.0-*",
"packOptions": {
"owners": [ "linq2dynamodb" ],
"projectUrl": "https://github.com/scale-tone/linq2dynamodb/",
"repository": { "url": "https://github.com/scale-tone/linq2dynamodb/" },
"summary": "A type-safe data context for AWS DynamoDB with LINQ and in-memory caching support. Allows to combine DynamoDB's durability with cache speed and read consistency.",
"releaseNotes": "Migrated to .Net Standard 1.6",
"releaseNotes": "ToListAsync() method. \n Fixed nuget references.",
"tags": [ "Linq2DynamoDb", "AWS", "DynamoDb", "context", "caching", "LINQ", ".Net" ]
},
"dependencies": {
"AWSSDK.DynamoDBv2": "3.3.2.1",
"NETStandard.Library": "1.6.1",
"System.Linq.Queryable": "4.3.0",
"System.Runtime.Serialization.Formatters": "4.3.0"
"AWSSDK.DynamoDBv2": "3.3.2.1"
},
"frameworks": {
"net462": {
"frameworkAssemblies": {}
},
"netstandard1.6": {
"imports": "dnxcore50"
"imports": "dnxcore50",
"dependencies": {
"NETStandard.Library": "1.6.1",
"System.Linq.Queryable": "4.3.0",
"System.Runtime.Serialization.Formatters": "4.3.0"
}
}
}
}

0 comments on commit 7519393

Please sign in to comment.