This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int NonqueryExecute(this SqlConnection sqlConnection, string sqlCommandText) | |
{ | |
int returnValue = 0; | |
try | |
{ | |
SqlCommand cmd = sqlConnection.CreateCommand(); | |
SqlTransaction transaction = sqlConnection.BeginTransaction(Guid.NewGuid().ToString().Substring(0, 7)); | |
cmd.Connection = sqlConnection; | |
cmd.Transaction = transaction; | |
cmd.CommandText = sqlCommandText; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TreeNode | |
{ | |
readonly List<TreeNode> ChildNodes = new List<TreeNode>(); | |
public string Id { get; } | |
public TreeNode(IEnumerable<TreeNode> childNodes, string id) | |
{ | |
Id = id; | |
if(childNodes != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BinaryTreeNode | |
{ | |
public BinaryTreeNode Left { get; set; } | |
public BinaryTreeNode Right { get; set; } | |
public string Id { get; } | |
public BinaryTreeNode(string id, BinaryTreeNode left, BinaryTreeNode right) | |
{ | |
Left = left; | |
Right = right; |