Reputation:
I have this code that returns a List
var addRoles = newRoles
.Where(x => oldRoles
.All(y => y != x))
.ToList();
I am using this in a method however the method requires a string array:
string[]
How can I make the addRoles variable into a string array?
Upvotes: 0
Views: 35
Reputation: 222582
Use ToArray()
var addRoles = newRoles
.Where(x => oldRoles
.All(y => y != x))
.ToArray();
Upvotes: 2