Created
December 21, 2020 11:11
-
-
Save AvgustPol/bf0a4797c70c2c151b1d3575dc523505 to your computer and use it in GitHub Desktop.
Generate string list for SQL IN Operator operation
This file contains hidden or 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
https://dotnetfiddle.net/8vZ7dz |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Generate string list for SQL IN Operator operation"); | |
int listSize = 3; | |
List<Guid> guidList = new List<Guid>(10); | |
string result = "("; | |
for(int i = 0; i < listSize; i++) | |
{ | |
guidList.Add( Guid.NewGuid() ); | |
} | |
guidList.ForEach(x => { | |
result += "'" + Guid.NewGuid().ToString() + "'" + ","; | |
}); | |
result = result.Remove(result.Length - 1); | |
result += ")"; | |
Console.WriteLine("Result: " + result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result