Monday 15 April 2013

c# - Fill a List inside a known object with LINQ? -


I am quite new to Linux, but just wanted to ask how the list & lt; String & gt; An object using LINQ?

What to do to get all the URLs from a specific user. This data is stored in an Azure table

My code is:

  public IEnumerable & lt; UserTable & gt; GetUserImages (UserTable pUser) {var results = U in this.context.usersTableQuery where u.UserName == Select pUser.UserName u.PhotosUrl // Photo URL is a list of strings and I know that here are some results ; It seems as if you always give a query to a user, and you want him to use his  PhotosUrl  list when it's true:  
  var user = This.context.usersTableQuery.FirstOrDefault (u = & gt; u.UserName == pUser.UserName); & Lt; String & gt; result; If (user == faucet) result = new list & lt; String & gt; (); Other results = user.photo URL;   

If there is a chance that if more than one user inquires from the user's given username, then you have to use the extension method:

  List & lt; String & gt; Results = this.context.usersTableQuery Where (u = & gt; u.UserName == pUser.UserName). Selection multiple (U = & gt; u.PhotosUrl) .toList (); An Affiliate keyword was not found in   

Select Maya syntax based queries. list & lt; List & lt; String & gt; & Gt; List in & lt; String & gt; .

No comments:

Post a Comment