Skip to content

Instantly share code, notes, and snippets.

@ebello
Created August 29, 2008 18:58
Show Gist options
  • Save ebello/8033 to your computer and use it in GitHub Desktop.
Save ebello/8033 to your computer and use it in GitHub Desktop.
public static string ToIDList<T, U>(List<U> lookuplist) where U : ILookup<T> where T : struct
{
List<U> lookupidlist = lookuplist.FindAll(delegate(U lookup)
{
return lookup.ID.HasValue;
});
string idlist = String.Empty;
if (lookupidlist != null)
{
string[] ids = new string[lookupidlist.Count];
for (int x = 0; x < lookupidlist.Count; x++)
{
ids[x] = lookupidlist[x].ID.ToString();
}
idlist = String.Join(",", Unique(ids));
}
return idlist;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment