-
Notifications
You must be signed in to change notification settings - Fork 313
Merge | SqlClientPermission #3262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…s only used there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Files not reviewed (1)
- src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj: Language not supported
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientPermission.netfx.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientPermission.netfx.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientPermission.netfx.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientPermission.netfx.cs
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3262 +/- ##
==========================================
+ Coverage 72.98% 73.03% +0.04%
==========================================
Files 299 299
Lines 57215 57194 -21
==========================================
+ Hits 41760 41770 +10
+ Misses 15455 15424 -31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
public override IPermission CreatePermission() | ||
{ | ||
return new SqlClientPermission(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public override IPermission CreatePermission() | |
{ | |
return new SqlClientPermission(this); | |
} | |
public override IPermission CreatePermission() => new SqlClientPermission(this); |
|
||
private bool _IsUnrestricted | ||
{ | ||
get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get => base.IsUnrestricted();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like function bodies enclosed in braces. And in this case, it matches the format of the sibling setter. The => notation increases code density, which isn't necessarily a good thing. Personal preference I guess.
public override IPermission Copy() | ||
{ | ||
return new SqlClientPermission(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public override IPermission Copy() | |
{ | |
return new SqlClientPermission(this); | |
} | |
public override IPermission Copy() => new SqlClientPermission(this); |
internal NameValuePermission CopyNameValue() | ||
{ | ||
return new NameValuePermission(this); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal NameValuePermission CopyNameValue() | |
{ | |
return new NameValuePermission(this); | |
} | |
internal NameValuePermission CopyNameValue() => new NameValuePermission(this); |
|
||
private bool _IsUnrestricted | ||
{ | ||
get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I like function bodies enclosed in braces. And in this case, it matches the format of the sibling setter. The => notation increases code density, which isn't necessarily a good thing. Personal preference I guess.
} | ||
|
||
string unrestrictedValue = securityElement.Attribute(XmlStr._Unrestricted); | ||
_IsUnrestricted = unrestrictedValue != null && bool.Parse(unrestrictedValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, but this seemingly benign assignment can (surprisingly) throw reflection exceptions, which we don't document. In fact, the docs don't claim this function will throw anything!
Description: This change is a bit heavier than it should be because of reasons...
Testing: For the most past, there are no functional changes. Code is moved around. CI should validate.