-
Notifications
You must be signed in to change notification settings - Fork 286
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
Move into shared for SqlCachedBuffer.cs #1280
Move into shared for SqlCachedBuffer.cs #1280
Conversation
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCachedBuffer.cs
Outdated
Show resolved
Hide resolved
… and netcore and it's internal
I decided to remove the |
Seems reasonable. We'll see if it affects any of the tests (which sometimes use private reflection) and if nothing is broken then it'll be a good cleanup. |
Unless there are merge conflicts I wouldn't suggest keeping all your PR's up to date with main. It will take you a lot of time and it can be months before the team are ready to review. |
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.
Modifiers could be reordered on ToString(): public override string ToString()
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCachedBuffer.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCachedBuffer.cs
Outdated
Show resolved
Hide resolved
public bool IsNull | ||
{ | ||
get | ||
{ | ||
return (_cachedBytes == null) ? true : false; | ||
} | ||
get => _cachedBytes == null; |
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.
NIT: It would be simpler using expression body syntax:
public bool IsNull => _cachedBytes is null;
|
||
|
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.
Extra lines; could be removed.
internal List<byte[]> CachedBytes | ||
{ | ||
get { return _cachedBytes; } | ||
get => _cachedBytes; | ||
} |
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.
NIT: This way it would be neater.
internal List<byte[]> CachedBytes => _cachedBytes;
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCachedBuffer.cs
Show resolved
Hide resolved
Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
Relating to issue #1261 . I moved the SqlCacheBuffer.cs from netcore to shared src and updated the reference in the netfx csproj. I did notice that in the
ToXmlReader
method was implemented differently between the two. I looked at the helper methodSqlTypeWorkarounds.SqlXmlCreateSqlXmlReader(...)
and it seems to be doing the same functionality without using reflection.