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

Popular posts from this blog

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -