Skip to content

Commit 548f882

Browse files
j82wJake Willey
authored andcommitted
Fixed LINQ with camel case. (#909)
* Fixed linq with camel case. * Updated changelog
1 parent a8e2ea5 commit 548f882

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public static class LinqMethods
8686
/// <returns>The corresponding SQL query.</returns>
8787
public static SqlQuery TranslateQuery(
8888
Expression inputExpression,
89-
IDictionary<object, string> parameters = null,
90-
CosmosSerializationOptions serializationOptions = null)
89+
IDictionary<object, string> parameters,
90+
CosmosSerializationOptions serializationOptions)
9191
{
9292
TranslationContext context = new TranslationContext(serializationOptions, parameters);
9393
ExpressionToSql.Translate(inputExpression, context); // ignore result here

Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ internal static string TranslateExpressionOld(
4242

4343
internal static SqlQuerySpec TranslateQuery(
4444
Expression inputExpression,
45-
CosmosSerializationOptions serializationOptions = null,
46-
IDictionary<object, string> parameters = null)
45+
CosmosSerializationOptions serializationOptions,
46+
IDictionary<object, string> parameters)
4747
{
4848
inputExpression = ConstantEvaluator.PartialEval(inputExpression);
49-
SqlQuery query = ExpressionToSql.TranslateQuery(inputExpression, parameters);
49+
SqlQuery query = ExpressionToSql.TranslateQuery(inputExpression, parameters, serializationOptions);
5050
string queryText = null;
5151
SqlParameterCollection sqlParameters = new SqlParameterCollection();
5252
if (parameters != null && parameters.Count > 0)

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,15 +404,15 @@ public async Task QueryableExtentionFunctionsTest()
404404

405405
[DataRow(false)]
406406
[DataRow(true)]
407+
[TestMethod]
407408
public async Task ItemLINQWithCamelCaseSerializerOptions(bool isGatewayMode)
408409
{
409410
Action<CosmosClientBuilder> builder = action =>
410411
{
411412
action.WithSerializerOptions(new CosmosSerializationOptions()
412413
{
413414
PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
414-
}
415-
);
415+
});
416416
if (isGatewayMode)
417417
{
418418
action.WithConnectionModeGateway();

changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ Preview features are treated as a separate branch and will not be included in th
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## <a name="3.3.1"/> [3.3.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.3.1) - 2019-10-11
8+
## Unreleased
9+
10+
### Fixed
11+
12+
- [#905](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/909) Fixed linq camel case bug
13+
14+
## <a name="3.3.1"/> [3.3.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.3.1) - 2019-10-11
915

1016
### Fixed
1117

0 commit comments

Comments
 (0)