Skip to content

Instantly share code, notes, and snippets.

@AvgustPol
Created December 21, 2020 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AvgustPol/bf0a4797c70c2c151b1d3575dc523505 to your computer and use it in GitHub Desktop.
Save AvgustPol/bf0a4797c70c2c151b1d3575dc523505 to your computer and use it in GitHub Desktop.
Generate string list for SQL IN Operator operation
https://dotnetfiddle.net/8vZ7dz
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);
}
}
@AvgustPol
Copy link
Author

Result

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment