Foxtable(狐表)用户栏目专家坐堂 → 请问:下面这段代码如果用狐表写?


  共有3380人关注过本帖平板打印复制链接

主题:请问:下面这段代码如果用狐表写?

帅哥哟,离线,有人找我吗?
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4723 积分:34352 威望:0 精华:0 注册:2008/8/31 22:44:00
请问:下面这段代码如果用狐表写?  发帖心情 Post By:2020/1/6 14:35:00 [只看该作者]

 'Create a collection act like a database
         Dim nbStorage = New Notebook() _
                         {New Notebook With {.Brand = "Lenovo", .Price = 27000, .Type = "X300", .Weight = 1.8} _
                         , New Notebook With {.Brand = "HP", .Price = 7500, .Type = "V3742TU", .Weight = 2.3} _
                         , New Notebook With {.Brand = "HP", .Price = 7800, .Type = "DV2730TX", .Weight = 2.2} _
                         , New Notebook With {.Brand = "DELL", .Price = 7300, .Type = "D630", .Weight = 2.5} _
                         }

        'Create the query
        'but the query will not execute right way
        Dim result1 = From laptop In nbStorage _
                    Where laptop.Price > 7400

        'Change some value before query executes
        nbStorage(0).Price = 26000

        'Execute the query
        For Each laptop In result1
            Console.WriteLine(laptop.ToString())
        Next

 回到顶部