Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed LINQ with camel case. #909

Merged
merged 2 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public static class LinqMethods
/// <returns>The corresponding SQL query.</returns>
public static SqlQuery TranslateQuery(
Expression inputExpression,
IDictionary<object, string> parameters = null,
CosmosSerializationOptions serializationOptions = null)
IDictionary<object, string> parameters,
CosmosSerializationOptions serializationOptions)
{
TranslationContext context = new TranslationContext(serializationOptions, parameters);
ExpressionToSql.Translate(inputExpression, context); // ignore result here
Expand Down
6 changes: 3 additions & 3 deletions Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ internal static string TranslateExpressionOld(

internal static SqlQuerySpec TranslateQuery(
Expression inputExpression,
CosmosSerializationOptions serializationOptions = null,
IDictionary<object, string> parameters = null)
CosmosSerializationOptions serializationOptions,
IDictionary<object, string> parameters)
{
inputExpression = ConstantEvaluator.PartialEval(inputExpression);
SqlQuery query = ExpressionToSql.TranslateQuery(inputExpression, parameters);
SqlQuery query = ExpressionToSql.TranslateQuery(inputExpression, parameters, serializationOptions);
string queryText = null;
SqlParameterCollection sqlParameters = new SqlParameterCollection();
if (parameters != null && parameters.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,15 @@ public async Task QueryableExtentionFunctionsTest()

[DataRow(false)]
[DataRow(true)]
[TestMethod]
j82w marked this conversation as resolved.
Show resolved Hide resolved
public async Task ItemLINQWithCamelCaseSerializerOptions(bool isGatewayMode)
{
Action<CosmosClientBuilder> builder = action =>
{
action.WithSerializerOptions(new CosmosSerializationOptions()
{
PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
}
);
});
if (isGatewayMode)
{
action.WithConnectionModeGateway();
Expand Down