Reputation: 1458
I am getting lists from service. But In that particular service i need only 2 fields values alone. I write a select query, but it is not returning all lists.
var TranslResult = serviceResponse.Result.ToList();
selectedReasons = TranslResult.Select(x => new TranslationContentEntity
{
ContentId= x.ContentId,
ContentType= x.ContentType
});
But i am getting result of the following,
Upvotes: 0
Views: 76
Reputation: 1364
You can use anonymous class like this :
selectedReasons = TranslResult.Select(x => new
{
ContentId= x.ContentId,
ContentType= x.ContentType
});
Upvotes: 2