Skip to content

Commit 15b0746

Browse files
conventionpack note and removing object in models (#60)
1 parent 896f6fe commit 15b0746

File tree

27 files changed

+63
-27
lines changed

27 files changed

+63
-27
lines changed

source/fundamentals/crud/read-operations/retrieve.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The following ``Restaurants`` class models the documents in this collection:
3232
:copyable:
3333
:dedent:
3434

35+
.. include:: /includes/convention-pack-note.rst
36+
3537
.. _csharp-retrieve-find:
3638

3739
Find Documents

source/fundamentals/crud/read-operations/specify-query.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ The following ``Guitar`` class models the documents in this collection.
4646
:copyable:
4747
:dedent:
4848

49+
.. note::
50+
51+
The documents in the ``guitars`` collection use the camel-case naming
52+
convention. The examples in this guide use a ``ConventionPack``
53+
to deserialize the fields in the collection into Pascal case and map them to
54+
the properties in the ``Guitar`` class.
55+
56+
To learn more about custom serialization, see :ref:`csharp-custom-serialization`.
57+
4958
To learn more about class mapping, see :ref:`csharp-class-mapping`.
5059

5160
The following code instantiates the ``_guitarsCollection`` object using the

source/fundamentals/crud/write-operations/change.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ collection use the following ``Restaurant`` class as a model:
3434
:start-after: start-model
3535
:end-before: end-model
3636

37+
.. include:: /includes/convention-pack-note.rst
38+
3739
This collection is from the :atlas:`sample datasets </sample-data>` provided
3840
by Atlas. See the :ref:`<csharp-quickstart>` to learn how to create a free MongoDB cluster
3941
and load this sample data.

source/fundamentals/crud/write-operations/delete.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ collection are modeled by the following ``Restaurant`` class:
3131
:start-after: start-model
3232
:end-before: end-model
3333

34+
.. include:: /includes/convention-pack-note.rst
35+
3436
This collection is from the :atlas:`sample datasets </sample-data>` provided
3537
by Atlas. See the :ref:`<csharp-quickstart>` to learn how to create a free MongoDB cluster
3638
and load this sample data.

source/fundamentals/crud/write-operations/insert.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ example are modeled by the following ``Restaurant`` class:
3131
:start-after: start-model
3232
:end-before: end-model
3333

34+
.. include:: /includes/convention-pack-note.rst
35+
3436
This collection is from the :atlas:`sample datasets </sample-data>` provided
3537
by Atlas. See the :ref:`<csharp-quickstart>` to learn how to create a free MongoDB cluster
3638
and load this sample data.

source/fundamentals/linq.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@ documents in this collection:
4747
:start-after: start-grade-model
4848
:end-before: end-grade-model
4949

50-
.. note::
51-
52-
The documents in the ``restaurants`` collection use the camel
53-
case naming convention. The examples in this guide use a ``ConventionPack``
54-
to deserialize the fields in the collection into Pascal case and map them to
55-
the properties in the ``Restaurant`` class.
56-
57-
To learn more about custom serialization see :ref:`csharp-custom-serialization`.
50+
.. include:: /includes/convention-pack-note.rst
5851

5952
.. _csharp-linq-queryable:
6053

source/includes/code-examples/delete-many/Restaurant.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public class Restaurant
1515

1616
public string Cuisine { get; set; }
1717

18-
public object Address { get; set; }
18+
public Address Address { get; set; }
1919

2020
public string Borough { get; set; }
2121

22-
public List<object> Grades { get; set; }
22+
public List<GradeEntry> Grades { get; set; }
2323
}
2424
// end-model

source/includes/code-examples/delete-one/Restaurant.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public class Restaurant
1515

1616
public string Cuisine { get; set; }
1717

18-
public object Address { get; set; }
18+
public Address Address { get; set; }
1919

2020
public string Borough { get; set; }
2121

22-
public List<object> Grades { get; set; }
22+
public List<GradeEntry> Grades { get; set; }
2323
}
2424
// end-model

source/includes/code-examples/find-many/Restaurant.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public class Restaurant
1515

1616
public string Cuisine { get; set; }
1717

18-
public object Address { get; set; }
18+
public Address Address { get; set; }
1919

2020
public string Borough { get; set; }
2121

22-
public List<object> Grades { get; set; }
22+
public List<GradeEntry> Grades { get; set; }
2323
}
2424
// end-model

source/includes/code-examples/find-one/Restaurant.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public class Restaurant
1515

1616
public string Cuisine { get; set; }
1717

18-
public object Address { get; set; }
18+
public Address Address { get; set; }
1919

2020
public string Borough { get; set; }
2121

22-
public List<object> Grades { get; set; }
22+
public List<GradeEntry> Grades { get; set; }
2323
}
2424
// end-model

0 commit comments

Comments
 (0)