Home C# Class select multiple fields in Xamarin
Reply: 0

C# Class select multiple fields in Xamarin

user456
1#
user456 Published in May 22, 2018, 4:36 am

I want to select multiple fields from a list. This is my code:

string[] NamesArray = Users
            .Select(i => new {  i.FirstName, i.LastName })
            .Distinct()
            .OrderByDescending(i => i.FirstName)
            .ToArray();

When I use this code the error is: 'Cannot implicitly convert type 'anonymous type: string FirstName, string LastName []' to string[]' What can I do???

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308491 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO