vb.net - List(Of T) groupby visual basic -


By grade I want group movies in Gridview. I have C # code and I want to convert it to Visual Basic

  on moviesByCategories = movies.GroupBy (X => x.Category). .Select (x => New MovieCategory {title = x, item = x.ToList ()});  

I have tried the following code but it gives me an error.

  Slow Query = Group film in movies in film. Title category = By film. Category GroupType = Group  

Upload converter. Tilik.com is recommended by Plutonics

  Moderate movies bycategories = movies.GroupBy (function (x) x.Category). [Select] (Function (X) New MovieCategory () {_ key.title = x.Key, _ key with .ems = x.ToList () _})  

But The code does not work Enter image details here

My classes 1. Movie page viewmodel

  Public category movies Pageviews Model Private _ List (in the form of movies) List of public property items () Go back (Movie category) Go back _Items set end ( List of values ​​as ByVal Value (MovieCategory's) _Items = Value End Set & Property All New () Movie List (of Film) = New List (Movie's) 'Dim MoviesByCategories = movies.GroupBy Adding Movies on Movies List (Function (X) x.Category). [Select] (function (A S) with the new moviecategory () {_key.title = x.key key, _keys.ems = x.ToList () _}} item = moviesByCategories End Sub ending class  

2 Get the string as public property title () as the .movie class

  public class movie string public property title () _Title end set (byVal value as string) _Title = End end end property set as private _Subtitle string public property compound Receive string return as a sucker () _Subtitle End Get Set (ByVal as Value string) _Subtitle = Value End Set & Property Private _Image string as the public property image () _Image and set as string return Go (By Value as String) _Image = value End Set End Property Get String Return as String Public Property Category () as Private Category _Category Set End (string As Value Value Values) _Category = Value End Set End Property All New (String As The Title, Category As String, Subtitle As String, IMG In The String) _Title = Title _Subtitle = Subtitle _Image = img _Category = Category End Sub Ending Class  
  1. MovieCategory

      public class movie category string as private _Title Receive string return as a public property title () _Title End Set (ByVal Value as String) _Title = value End Set End Property Private_Items As the list (Movie's) Public Property Items (Movie) Return _Items End Set (ByVal Price List (Movie) ) _Items = Price End Set End Property End Class  Go 

    Update Now I get this error after I

Query Syntax (which I have in VB.NET I like it):

  In the Movies group in the query = movy.CategoryIn MovyCategoryGroup = Group with dim query = movy {New.} With the new MovieCategory {.Title = Category, .asms = MovyCategoryGroup. ToList ()}  

method syntax:

  slow query = movies. Group (function (m) m.Category). Select (New Movie Category with Function (G) {title = GK, .imes = G.T.List ()})  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -