dotnet / dotnet/SqlClient

Remark on SqlConnectionStringBuilder.ShouldSerialize method is not universally true.

Open
#1,851 1 comment 0 reactions 0 assignees View on GitHub
Area\Documentation
Dominant language
C#
Stars
989
Forks
340
Avg merge
4d 18h
Merged PRs (30d)
69

Description

https://github.com/dotnet/SqlClient/blob/03f305389139eff2dfc2c67ad3b564a9f1dd3325/doc/snippets/Microsoft.Data.SqlClient/SqlConnectionStringBuilder.xml#L910

In order to make the correct decision between using ShouldSerialize and ContainsKey,
As an API consumer
I would like to understand the distinction between the two, and ideally the scenarios to which each is best suited (as I'm sure there was intent in the distinction which has not been disclosed in the documentation).

The Remark needs elaboration to detail the context in which the statement may be true, and perhaps the rationale for the difference (or simply remove the Remark).
See the below repro (fsi).

```f#
> let builder = SqlConnectionStringBuilder "";;
val builder: SqlConnectionStringBuilder = dict []

> builder.ContainsKey "Application Name";;
val it: bool = true

> builder.ShouldSerialize "Application Name";;
val it: bool = false
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.