Skip to content

Commit 59ebf89

Browse files
committed
add camel case note
1 parent 9cb1311 commit 59ebf89

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/crud/query/project.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ The following class represents the documents in the ``sample_mflix.movies`` coll
3636
.. literalinclude:: /includes/code-examples/projection/Movie.cs
3737
:language: csharp
3838

39+
.. note:: ConventionPack for Pascal Case
40+
41+
The properties in the preceding class are named in Pascal case, but the
42+
field names in the MongoDB collection use camel case. To account for this difference,
43+
you can use the following code to register a ``ConventionPack`` when your
44+
application starts:
45+
46+
.. code-block:: csharp
47+
48+
var camelCaseConvention = new ConventionPack { new CamelCaseElementNameConvention() };
49+
ConventionRegistry.Register("CamelCase", camelCaseConvention, type => true);
50+
3951
.. _csharp-projection-methods:
4052

4153
Create a Projection

0 commit comments

Comments
 (0)