locked
Simple Linear Search in Visual Basic 2013 - Tutorial Item Not Working

    Question

  • This is in Visual Basic XAML .... Not C or Javascript ...

    I've been banging my head on trying to figure out how to solve how the 2013 upgrade is different.  Specifically this is on one point and I cannot figure out where to go with creating the application differently in the Simple Linear search for the Blog Reader in the application at http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx.

    I am looking for how to re-write the aspects of the GetFeed and GetItem Functions that are present in the 2012 version to 2013.

    The code that I am having problems with on converting is the following area in the FeedData.vb (Class):

        Public Shared Function GetFeed(title As String) As FeedData
            ' Simple linear search is acceptable for small data sets
            Dim _feedDataSource = DirectCast(App.Current.Resources("feedDataSource"), FeedDataSource)

            Dim matches = _feedDataSource.Feeds.Where(Function(feed) feed.Title.Equals(title))
            If matches.Count() = 1 Then
                Return matches.First()
            End If
            Return Nothing
            If matches.Count() = 1 Then
                Return matches.First()
            End If
            Return Nothing
        End Function

        Public Shared Function GetItem(uniqueId As String) As FeedItem
            ' Simple linear search is acceptable for small data sets
            Dim _feedDataSource = DirectCast(App.Current.Resources("feedDataSource"), FeedDataSource)
            Dim _feeds = _feedDataSource.Feeds

            Dim matches = _feedDataSource.Feeds.SelectMany(Function(group) group.Items).Where(Function(item) item.Title.Equals(uniqueId))

            If matches.Count() = 1 Then
                Return matches.First()
            End If
            Return Nothing
        End Function
    End Class


    • Edited by GoliathRulz Friday, May 23, 2014 3:16 PM Clarification on Programming Language Conversion
    Friday, May 23, 2014 3:14 PM

All replies

  • Hi,

    There is not enough information about your question. And the link you give is broken. Why you re-write the aspects of the GetFeed and GetItem Functions that are present in the 2012. As far as i know, windows 8 store app can run in windows 8.1 and VS2013. According to your description, you want to create a blog reader app, if so, you can refer to the link below:

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/br211380.aspx

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, May 26, 2014 2:02 AM
  • Actually that is the link I used to work the solution and pretty much followed it all the way up to the GetFeed and GetItem in VS2013 and then it broke. The example states right in the beginning "write the code to the new standard.  I can't find anything anywhere on VS2013 on how to do this. 

    Yes, I could just use VS2012 and not start working in VS2013 but that is really not the point.  I would like to not develop a solution in an old version right off the start, but rather I would like to build the RSS reader solution in VS2013 with the new process for doing something like GetFeed and GetItem.  

    Thanks in advance for the assistance


    M. Frenchik Developer At Large

    Thursday, May 29, 2014 11:55 AM
  • Hi,

    I cannot open the link you post in the forum. You should share a reproduce sample in the skyDrive or give more information about the GetFeed and GetItem method.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, June 4, 2014 6:46 AM