Skip to content
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

Merge common code bases for TdsParserStateObject.cs #1520

Merged
merged 20 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
22c25f5
Merging common fields, properties and types of TdsParserStateObject.
panoskj Feb 21, 2022
4ec17f6
Merging common type NullBitmap of TdsParserStateObject.
panoskj Feb 21, 2022
de83b8d
Merging a few methods of TdsParserStateObject.
panoskj Feb 21, 2022
d15a7d3
Merging constructor of TdsParserStateObject.
panoskj Feb 21, 2022
927e4a6
Merging some methods of TdsParserStateObject.
panoskj Feb 21, 2022
2c81d54
Merging ObjectID property of TdsParserStateObject.
panoskj Feb 21, 2022
72d8e54
Merge remote-tracking branch 'upstream/main' into MergeTdsParserState…
DavoudEshtehari Mar 15, 2022
417a6da
Merging some methods of TdsParserStateObject (note: ports part of #10…
panoskj Mar 18, 2022
b8eb31d
Merging some methods of TdsParserStateObject (note: uses some #if dir…
panoskj Mar 18, 2022
c145b8d
Merge branch 'main' into MergeTdsParserStateObject
panoskj Aug 26, 2022
ed279eb
Merge branch 'main' into MergeTdsParserStateObject
panoskj Oct 5, 2022
4e6ed9a
TdsParserStateObject: Fixed naming rules violations.
panoskj Oct 5, 2022
315acb1
TdsParserStateObject: Removed unnecessary assignments. Used discard t…
panoskj Oct 5, 2022
87f0cba
TdsParserStateObject: Simplified names.
panoskj Oct 5, 2022
d71028b
TdsParserStateObject: Simplified default expression.
panoskj Oct 5, 2022
3e05aeb
TdsParserStateObject: Removed unnecessary casts.
panoskj Oct 5, 2022
58ae136
TdsParserStateObject: Replaced var usages with explicit types.
panoskj Oct 5, 2022
5eb4a61
Apply suggestions from code review
DavoudEshtehari Nov 8, 2022
f75d911
Merge remote-tracking branch 'upstream/main' into MergeTdsParserState…
DavoudEshtehari Nov 8, 2022
0b4c345
Address comments
DavoudEshtehari Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParameterSetter.cs">
<Link>Microsoft\Data\SqlClient\TdsParameterSetter.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStateObject.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStateObject.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStaticMethods.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStaticMethods.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ internal EncryptionOptions EncryptionOptions
}
}

internal bool Is2005OrNewer => true;

internal bool Is2008OrNewer
{
get
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs">
<Link>Microsoft\Data\SqlClient\TdsParserSafeHandles.Windows.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStateObject.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStateObject.cs</Link>
</Compile>
<Compile Include="..\..\src\Microsoft\Data\SqlClient\TdsParserStaticMethods.cs">
<Link>Microsoft\Data\SqlClient\TdsParserStaticMethods.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ internal static Task CreateContinuationTask(Task task, Action onSuccess, SqlInte
}
}

internal static Task CreateContinuationTaskWithState(Task task, object state, Action<object> onSuccess, Action<Exception, object> onFailure = null)
{
if (task == null)
{
onSuccess(state);
return null;
}
else
{
var completion = new TaskCompletionSource<object>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try using explicit type instead of var please.

DavoudEshtehari marked this conversation as resolved.
Show resolved Hide resolved
ContinueTaskWithState(task, completion, state,
onSuccess: (object continueState) =>
{
onSuccess(continueState);
completion.SetResult(null);
},
onFailure: onFailure
);
return completion.Task;
}
}

internal static Task CreateContinuationTask<T1, T2>(Task task, Action<T1, T2> onSuccess, T1 arg1, T2 arg2, SqlInternalConnectionTds connectionToDoom = null, Action<Exception> onFailure = null)
{
return CreateContinuationTask(task, () => onSuccess(arg1, arg2), connectionToDoom, onFailure);
Expand Down

Large diffs are not rendered by default.

Loading