Steps for a beginner to run very basic linq to sql query using Linqpad

前端 未结 4 1963
长情又很酷
长情又很酷 2021-02-04 04:36

Trying to learn Linq using LinqPad and getting frustated with how to start on it. Let\'s say I want to write a C# Expression and a C# statment where I have a table in SQL server

4条回答
  •  猫巷女王i
    2021-02-04 05:11

    Just wanted to add - LINQ pad pluralizes - I did not know this and it drove me crazy for a good fifteen minutes

    I was trying to select from a table called DentalApplication

        DentalApplication.Where(a=> a.PackageID > 0)
    

    Gave me this error

        'LINQPad.User.DentalApplication' does not contain a definition for 'Where'
    

    Changed it to

        DentalApplications.Where(a=> a.PackageID > 0)
    

    and it worked

提交回复
热议问题