Comments (4)
the reason that db.Query().ToList()
returns the lastName
(with the lower l
) member is because json.net deserialize
object members if it's camelcased in the json(in your case lastName
is camelcase of LastName
). but this behavior is not at serializing objects( AQL.Contains(e.LastName, "b")
will translate to aql syntax contains(e.LastName,"b")
).
lastName
& LastName
are two different document members for the ArangoDB database. you could have both of them in an object. did you load Person
collection with import tools? if yes try to validate the member names before inserting them(.net client also has a method for import, db.Advanced.BulkImport
which is not in nuget package yet)
also there are helper methods in .net client that you can override member name resolving( which does not solve your problem, you should rename lastName
& LastName
fields to one thing)
sharedSetting.Collection.ChangeCollectionPropertyForType<Person>(x =>
{
// will resolve all collection members name from PascalCase(c#) to camelcase(ArangoDB)
x.Naming = NamingConvention.ToCamelCase;
});
sharedSetting.Collection.ChangeDocumentPropertyForType<Person>(x => x.LastName, (p) =>
{
// set the name for just one member
p.PropertyName = "lastName";
// naming convection for just one member
p.Naming = NamingConvention.ToCamelCase;
});
from arangoclient.net.
thanks for prompt and detailed response. However, I hope that you see why I find this confusing. From my perspective it would be better if this behavior was more consistent i.e. either arango lastName wouldn't be mapped to LastName in C# while using db.Query().ToList() or if field content was included while using db.Query().Where(e => AQL.Contains(e.LastName, "b")).ToList()
from arangoclient.net.
you're right, the resolving names should be consistent either in serializing/serializing, i wont close the issue for now.
from arangoclient.net.
@adamlubek about consistent member name resolving, json.net behaves First attempts to get an exact case match of propertyName and then a case insensitive match
according to http://www.newtonsoft.com/json/help/html/M_Newtonsoft_Json_Serialization_JsonPropertyCollection_GetClosestMatchProperty.htm
from arangoclient.net.
Related Issues (20)
- ArangoServerException not throw when db unavailable HOT 2
- Thread safety HOT 7
- Confused with SystemDatabaseCredential HOT 5
- Custom Index HOT 6
- ByExampleAsync missing HOT 2
- Make ChangeCollectionPropertyForType public HOT 1
- Using LINQ query with Where performance HOT 1
- Error in generated AQL when upserting a generic document HOT 7
- ArangoServerException eats up all the useful information like status code and error number HOT 2
- Make collection name resolver more extensible HOT 2
- Annotating a property of type Guid as DocumentProperty.Key throws InvalidCastException HOT 2
- Support private setter
- CreateStatement<object> & Remove Vertex HOT 1
- Ternary operator support
- Global error handling policy
- Support for keyOptions: uuid
- Edge Document API not supported?
- Cannot Simply Connect to Server...... HOT 2
- Secure connection to ArangoDB
- Query directly within a collection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arangoclient.net.