tags:

views:

341

answers:

1

Is there any relation with LINQ and dbml file.someone telling that using Linq in project .Actually that project containing one dbml file,inside that one .cs file,one dbml.layout and designer generated code.Actually notation is something like

var numQuery =
            from num in numbers
            where (num % 2) == 0
            select num;

i didnt find any of the similar syntax in this project

+2  A: 

The DBML file represents the data model for a LINQ to SQL project - it's used to generate the C# code for the various entities.

The code you've provided is a LINQ query. I'd certainly expect to see LINQ queries within an application which uses a DBML file, but they are slightly separate. In particular, I wouldn't expect to see queries either within the DBML file itself or in the C# code generated from it. The queries will be in the code which uses those entities.

Jon Skeet
but i didnt find any linq queries in our project,..
peter
Don't forget that LINQ queries don't *have* to be written with query expression syntax - if it uses .Where, .Select etc that's a query too. Also you may be using it as a data source for controls. Basically look at what's in the DBML file, and see whether you're using any of the generated code anywhere.
Jon Skeet
(The quickest way to do that might be to delete the DBML file and the generated code, and see whether it still builds. Only do this if you have the code in source control though!)
Jon Skeet