Skip to content

Commit

Permalink
Fixed doc errors. Docs build.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshClose committed Jan 24, 2024
1 parent 52f2c9e commit c3b50cd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ <h6 id="example">Example</h6>
{
Map(m =&gt; m.Id);
Map(m =&gt; m.Name);
Map(m =&gt; m.Json).Convert(row =&gt; JsonConvert.DeserializeObject&lt;Json&gt;(row.GetField(&quot;Json&quot;)));
Map(m =&gt; m.Json).Convert(args =&gt; JsonConvert.DeserializeObject&lt;Json&gt;(args.Row.GetField(&quot;Json&quot;)));
}
}
</code></pre>
Expand Down Expand Up @@ -480,7 +480,7 @@ <h6 id="example-1">Example</h6>
{
Map(m =&gt; m.Id);
Map(m =&gt; m.Name);
Map(m =&gt; m.Json).Convert(o =&gt; JsonConvert.SerializeObject(o));
Map(m =&gt; m.Json).Convert(args =&gt; JsonConvert.SerializeObject(args.Row));
}
}
</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/prerequisites/using-and-dispose/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,15 @@
<div class="column">
<div class="content">
<h1 id="using-and-dispose">Using and Dispose</h1>
<p>Whenever you have an object the implements <code>IDisposable</code>, you need to dispose of the resource when you're done with it. Most classes that use unmanaged resources will implement <code>IDisposable</code>. This means a lot of classes in the <code>System.IO</code> namespace will need to be disposed of.</p>
<p>Whenever you have an object that implements <code>IDisposable</code>, you need to dispose of the resource when you're done with it. Most classes that use unmanaged resources will implement <code>IDisposable</code>. This means a lot of classes in the <code>System.IO</code> namespace will need to be disposed of.</p>
<p>The best practice to dispose of an object when you're done with it is to wrap the code in a <code>using</code> block. When the <code>using</code> block exits, the resource will automatically be disposed of as soon as possible.</p>
<pre><code class="language-cs">using (var stream = new MemoryStream())
{
// Use the stream.
}
// The stream will be disposed of as soon as possible.
</code></pre>
<p>If you need to keep keep it around for a while and dispose of it later, <code>using</code> does some error handling for you, so it's still a good idea to use it instead of calling <code>Dispose</code> directly. There is some debate on whether this is a good idea because it doesn't show intent.</p>
<p>If you need to keep it around for a while and dispose of it later, <code>using</code> does some error handling for you, so it's still a good idea to use it instead of calling <code>Dispose</code> directly. There is some debate on whether this is a good idea because it doesn't show intent.</p>
<pre><code class="language-cs">var stream = new MemoryStream();
// Later in a different part of your code.
using (stream) { }
Expand Down
2 changes: 1 addition & 1 deletion docs/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>/CsvHelper/CsvHelper/google6ad86f23ff698b61</loc></url><url><loc>/CsvHelper/CsvHelper/api</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-index</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-anonymous-type-objects</loc></url><url><loc>/CsvHelper/CsvHelper/examples</loc></url><url><loc>/CsvHelper/CsvHelper/change-log</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/auto-mapping</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/attributes</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/constant-value</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/inline-type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/ignoring-properties</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-properties</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-name</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-alternate-names</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/optional-maps</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-duplicate-names</loc></url><url><loc>/CsvHelper/CsvHelper/examples/csvdatareader</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/validation</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/enumerate-class-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/using-and-dispose</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/reading-and-writing-files</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-anonymous-type-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/streams</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-by-hand</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v13</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-multiple-record-types</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-class-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-multiple-data-sets</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v14</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-dynamic-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v22</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-class-objects</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion/custom-type-converter</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/appending-to-an-existing-file</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v23</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-dynamic-objects</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion/type-converter-options</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v3</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v30</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v8</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v9</loc></url><url><loc>/CsvHelper/CsvHelper/getting-started</loc></url><url><loc>/CsvHelper/CsvHelper/migration</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v15</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v10</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v16</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v20</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v24</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v11</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v21</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v25</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v12</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v26</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v4</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v17</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v27</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v5</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v18</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v28</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v6</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v19</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v29</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v7</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v2</loc></url><url><loc>/CsvHelper/CsvHelper</loc></url></urlset>
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>/CsvHelper/CsvHelper/google6ad86f23ff698b61</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v17</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v18</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-dynamic-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-multiple-record-types</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v10</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v19</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v20</loc></url><url><loc>/CsvHelper/CsvHelper/api</loc></url><url><loc>/CsvHelper/CsvHelper/change-log</loc></url><url><loc>/CsvHelper/CsvHelper/examples</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/attributes</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v15</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/enumerate-class-records</loc></url><url><loc>/CsvHelper/CsvHelper/getting-started</loc></url><url><loc>/CsvHelper/CsvHelper/migration</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v23</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v26</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/auto-mapping</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/inline-type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-properties</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v25</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v16</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v29</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v3</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/ignoring-properties</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-name</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/optional-maps</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/constant-value</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/streams</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v6</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v24</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-index</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-class-records</loc></url><url><loc>/CsvHelper/CsvHelper/examples/csvdatareader</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-by-alternate-names</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v5</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion/custom-type-converter</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/type-conversion</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v11</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/using-and-dispose</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-multiple-data-sets</loc></url><url><loc>/CsvHelper/CsvHelper/examples/prerequisites/reading-and-writing-files</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/reading-by-hand</loc></url><url><loc>/CsvHelper/CsvHelper/examples/type-conversion/type-converter-options</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v2</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-class-objects</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/appending-to-an-existing-file</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v7</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-dynamic-objects</loc></url><url><loc>/CsvHelper/CsvHelper/examples/writing/write-anonymous-type-objects</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v8</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v12</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v13</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/mapping-duplicate-names</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v21</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v22</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v30</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v4</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v9</loc></url><url><loc>/CsvHelper/CsvHelper/examples/configuration/class-maps/validation</loc></url><url><loc>/CsvHelper/CsvHelper/examples/reading/get-anonymous-type-records</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v28</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v14</loc></url><url><loc>/CsvHelper/CsvHelper/migration/v27</loc></url><url><loc>/CsvHelper/CsvHelper</loc></url></urlset>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class FooMap : ClassMap<Foo>
{
Map(m => m.Id);
Map(m => m.Name);
Map(m => m.Json).Convert(row => JsonConvert.DeserializeObject<Json>(row.GetField("Json")));
Map(m => m.Json).Convert(args => JsonConvert.DeserializeObject<Json>(args.Row.GetField("Json")));
}
}
```
Expand Down Expand Up @@ -87,7 +87,7 @@ public class FooMap : ClassMap<Foo>
{
Map(m => m.Id);
Map(m => m.Name);
Map(m => m.Json).Convert(o => JsonConvert.SerializeObject(o));
Map(m => m.Json).Convert(args => JsonConvert.SerializeObject(args.Row));
}
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Using and Dispose

Whenever you have an object the implements `IDisposable`, you need to dispose of the resource when you're done with it. Most classes that use unmanaged resources will implement `IDisposable`. This means a lot of classes in the `System.IO` namespace will need to be disposed of.
Whenever you have an object that implements `IDisposable`, you need to dispose of the resource when you're done with it. Most classes that use unmanaged resources will implement `IDisposable`. This means a lot of classes in the `System.IO` namespace will need to be disposed of.

The best practice to dispose of an object when you're done with it is to wrap the code in a `using` block. When the `using` block exits, the resource will automatically be disposed of as soon as possible.

Expand All @@ -12,7 +12,7 @@ using (var stream = new MemoryStream())
// The stream will be disposed of as soon as possible.
```

If you need to keep keep it around for a while and dispose of it later, `using` does some error handling for you, so it's still a good idea to use it instead of calling `Dispose` directly. There is some debate on whether this is a good idea because it doesn't show intent.
If you need to keep it around for a while and dispose of it later, `using` does some error handling for you, so it's still a good idea to use it instead of calling `Dispose` directly. There is some debate on whether this is a good idea because it doesn't show intent.

```cs
var stream = new MemoryStream();
Expand Down

0 comments on commit c3b50cd

Please sign in to comment.