Ogi
Ogi

Reputation: 13

Linq to sql select db_id()

How to make query for db_id() in Linq to SQL. PLease help.

Upvotes: 0

Views: 176

Answers (2)

oryol
oryol

Reputation: 5248

You even can map method to the standard function. Add following code in the dbml and use dataContext.DbId() (you can use it inside query also):


<Function Name="db_id" Method="DbId" IsComposable="true">
  <Return Type="System.Int32" />
</Function>

Upvotes: 0

leppie
leppie

Reputation: 117330

Expose it as a function or stored procedure.

Upvotes: 1

Related Questions