Skip to content

Commit 6c723a3

Browse files
fix: error CS1061: 'ReadingContext' does not contain a definition for 'RegisterClassMap' and no accessible extension method 'RegisterClassMap'
There is no function in the class Context so i searched for and find that it must be called "Configuration". The full error message in Unity: error CS1061: 'ReadingContext' does not contain a definition for 'RegisterClassMap' and no accessible extension method 'RegisterClassMap' accepting a first argument of type 'ReadingContext' could be found.
1 parent d0b6e3b commit 6c723a3

File tree

1 file changed

+4
-1
lines changed
  • docs/examples/configuration/class-maps/mapping-by-name

1 file changed

+4
-1
lines changed

docs/examples/configuration/class-maps/mapping-by-name/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,13 @@ <h6 id="data">Data</h6>
412412
<h6 id="example">Example</h6>
413413
<pre><code class="language-cs">void Main()
414414
{
415+
using CsvHelper;
416+
using CsvHelper.Configuration;
417+
415418
using (var reader = new StreamReader(&quot;path\\to\\file.csv&quot;))
416419
using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
417420
{
418-
csv.Context.RegisterClassMap&lt;FooMap&gt;();
421+
csv.Configuration.RegisterClassMap&lt;FooMap&gt;();
419422
var records = csv.GetRecords&lt;Foo&gt;();
420423
}
421424
}

0 commit comments

Comments
 (0)