Shetty
Shetty

Reputation: 1892

Convert ObjectResult<string> to ObjectModel.Collection<string>

One of the data member in my data contract is of type System.Collections.ObjectModel.Collection<string>. I am getting a result of type ObjectResult<string> after executing a function import . How to convert objectresult<string> to ObjectModel.Collection<string>. Is there any direct cast exists?

Upvotes: 2

Views: 3734

Answers (1)

Haris Hasan
Haris Hasan

Reputation: 30097

ObjectModel.Collection<string> col = new ObjectModel.Collection<string>(objectResult.ToList());

Upvotes: 3

Related Questions