c# - Convert a Collection of Strings into Collection of GUID -
i reading collection of strings (of guid format)
excel
, want store them in database collection of guids
. wondering there clean way convert list<string>
list<guid>
using linq
. not interested in looping through.
either linq:
list<guid> guids = guidstrings.select(guid.parse).tolist();
or list.convertall
little bit more efficient because knows size:
list<guid> guids = guidstrings.convertall(guid.parse);
Comments
Post a Comment