Reputation: 21
I want to create Nhibernate C# query for below sql query,
SELECT ContactID
FROM Person.Contact WITH (INDEX(AK_Contact_rowguid))
GO
How can I do this ?
Upvotes: 2
Views: 386
Reputation: 117
you need to use the methode .CreateSqlQuery() like this exemple :
var SessionFactory = Configuration.BuildSessionFactory();
ISession session = SessionFactory.OpenSession()
session.CreateSQLQuery("SELECT ContactID FROM Person.Contact WITH (INDEX(AK_Contact_rowguid))");
for more information check this link
Upvotes: 0