Skip to content

Commit b4c53e8

Browse files
authored
Changing o to options for Xamarin docs (#12317)
* Update dotnet.xamarin.mdx Avoiding single-character variable names * Update dotnet.xamarin.mdx * Update dotnet.mdx * Update index.mdx (#12316) * Update platform-includes/configuration/config-intro/dotnet.xamarin.mdx * Update dotnet.mdx * Update dotnet.mdx
1 parent 9f37c74 commit b4c53e8

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

Diff for: docs/platforms/dotnet/common/migration/index.mdx

+10-10
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ To align with other SDKs, the option is now named: `DiagnosticLogger`
262262

263263
`SentryOptions` now take a string for `Dsn`:
264264

265-
Before: `o.Dsn = new Dsn("..");`
266-
After: `o.Dsn = "..";`
265+
Before: `options.Dsn = new Dsn("..");`
266+
After: `options.Dsn = "..";`
267267

268268
#### `LogEntry` Became `Message`
269269

@@ -402,23 +402,23 @@ Changed how to initialize Sentry:
402402
SentrySdk.Init("___PUBLIC_DSN___");
403403

404404
// Initialize with options
405-
SentrySdk.Init(o =>
405+
SentrySdk.Init(options =>
406406
{
407-
o.Dsn = "___PUBLIC_DSN___";
407+
options.Dsn = "___PUBLIC_DSN___";
408408
});
409409
```
410410

411-
For ASP.NET (classic) integration, add `Sentry.AspNet` package and initialize it by calling `o.AddAspNet()`:
411+
For ASP.NET (classic) integration, add `Sentry.AspNet` package and initialize it by calling `options.AddAspNet()`:
412412

413413

414414
```csharp
415415
using Sentry.AspNet;
416416

417-
SentrySdk.Init(o =>
417+
SentrySdk.Init(options =>
418418
{
419-
o.Dsn = "___PUBLIC_DSN___";
419+
options.Dsn = "___PUBLIC_DSN___";
420420

421-
o.AddAspNet();
421+
options.AddAspNet();
422422
});
423423
```
424424

@@ -472,9 +472,9 @@ ravenClient.BeforeSend = requester =>
472472
};
473473

474474
// After
475-
SentrySdk.Init(o =>
475+
SentrySdk.Init(options =>
476476
{
477-
o.BeforeSend = e =>
477+
options.BeforeSend = e =>
478478
{
479479
// Mutate the event or return null to drop it altogether
480480
return e;

Diff for: platform-includes/configuration/config-intro/dotnet.xamarin.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ pass the option object along for modifications:
33

44

55
```csharp
6-
SentryXamarin.Init(o =>
6+
SentryXamarin.Init(options =>
77
{
8-
o.Dsn = "___PUBLIC_DSN___";
9-
o.AddXamarinFormsIntegration();
10-
o.MaxBreadcrumbs = 50;
11-
o.Debug = true;
8+
options.Dsn = "___PUBLIC_DSN___";
9+
options.AddXamarinFormsIntegration();
10+
options.MaxBreadcrumbs = 50;
11+
options.Debug = true;
1212
});
1313
// app code here
1414
```

Diff for: platform-includes/enriching-events/attachment-upload/dotnet.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SentrySdk.ConfigureScope(scope =>
66
});
77

88
// Local Scope
9-
SentrySdk.CaptureMessage("my message", configureScope =>
9+
SentrySdk.CaptureMessage("my message", scope =>
1010
{
1111
scope.AddAttachment("log.txt");
1212
});

Diff for: platform-includes/getting-started-config/dotnet.xamarin.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ on MainActivity for Android, and, the top of FinishedLaunching on AppDelegate fo
33

44

55
```csharp
6-
SentryXamarin.Init(o =>
6+
SentryXamarin.Init(options =>
77
{
8-
o.AddXamarinFormsIntegration();
8+
options.AddXamarinFormsIntegration();
99
// Tells which project in Sentry to send events to:
10-
o.Dsn = "___PUBLIC_DSN___";
10+
options.Dsn = "___PUBLIC_DSN___";
1111
// When configuring for the first time, to see what the SDK is doing:
12-
o.Debug = true;
12+
options.Debug = true;
1313
// Set TracesSampleRate to 1.0 to capture 100%
1414
// of transactions for tracing.
1515
// We recommend adjusting this value in production
16-
o.TracesSampleRate = 1.0;
16+
options.TracesSampleRate = 1.0;
1717
});
1818
// App code
1919

Diff for: platform-includes/performance/automatic-instrumentation-integrations/dotnet.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Starting with version 3.9.0, the SDK automatically integrates with Entity Framew
99
If you don't want to have this integration, you can disable it on `SentryOptions` by calling `DisableDiagnosticSourceIntegration();`
1010

1111
```csharp
12-
option.DisableDiagnosticSourceIntegration();
12+
options.DisableDiagnosticSourceIntegration();
1313
```
1414

1515
If your project doesn't match any of the conditions above, (for example, it targets .NET Framework 4.6.1 and uses only the `Sentry` package), you can still manually activate those instrumentations by including the package `Sentry.DiagnosticSource` and enabling it during on the SDK's initialization.
1616

1717
```csharp
1818
// Requires NuGet package: Sentry.DiagnosticSource
19-
option.AddDiagnosticSourceIntegration();
19+
options.AddDiagnosticSourceIntegration();
2020
```
2121

2222
### Entity Framework Core Integration

Diff for: platform-includes/performance/opentelemetry-setup/dotnet.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ var builder = Sdk.CreateTracerProviderBuilder()
6161
Next, initialize Sentry and opt into the use of OpenTelemetry. Provide the SDK with the builder for OpenTelemetry's tracer provider to allow sending spans to Sentry.
6262

6363
```csharp
64-
_sentry = SentrySdk.Init(o =>
64+
_sentry = SentrySdk.Init(options =>
6565
{
66-
//o.Dsn = "...Your DSN...";
67-
o.TracesSampleRate = 1.0;
68-
o.AddAspNet(RequestSize.Always);
69-
o.UseOpenTelemetry(builder);
66+
//options.Dsn = "...Your DSN...";
67+
options.TracesSampleRate = 1.0;
68+
options.AddAspNet(RequestSize.Always);
69+
options.UseOpenTelemetry(builder);
7070
});
7171
```
7272

0 commit comments

Comments
 (0)