Closed megyfexid closed 6 years ago
I get the error when calling this:
var approver = ctx.Customer.Where(c => c.CustomerId == ArticlesDataContext.loggedInCustomerId).ToList().First();
We even have a test for List(string) fields, and it passes.
Can you elaborate on how you created that particular DynamoDB record you're trying to read? Was it created by Linq2DynamoDB or by some external code? Or manually maybe? Can you please show the JSON of that record? Can you please try to create that record with Linq2DynamoDB and try to read it?
No sound from the author, so closing this.
If I try to used__2.MoveNext() in C:\Projects\angular4-seed\webapi\Controllers\ArticlesController.cs:line 62
List<string>
as a property type I get: 'System.InvalidCastException' in Linq2DynamoDb.DataContext.dll Unable to cast object of type 'Amazon.DynamoDBv2.DocumentModel.DynamoDBList' to type 'Amazon.DynamoDBv2.DocumentModel.PrimitiveList'. at lambda_method(Closure , DynamoDBEntry ) at Linq2DynamoDb.DataContext.Utils.DynamoDbConversionUtils.ToObject(Document doc, Type entityType) at Linq2DynamoDb.DataContext.ReaderBase1.<.ctor>b__0_0(Document doc) at Linq2DynamoDb.DataContext.ReaderBase
1.SetCurrent(Document doc) at Linq2DynamoDb.DataContext.TableDefinitionWrapperBase.SingleDocReader1.MoveNext() at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable
1 source) at webapi.Controllers.ArticlesController.My class looks like this:
The workaround at the moment is to wrap the string in another class: