c# - Using IQuery CreateQuery in NHibernate Performance is slow -


i'm facing performance issues using createquery, createsqlquery & createcriteria. when use these fetching data takes atleast 4-5 seconds. when run same query in query editor sql server management studio executes in less second. tried googling couldn't find solution. i'm bit confused why nhibernate taking time execute simple queries.

below required code

public ilist<masterforecastinputsourcematch> getmasterforecastinputsourcematchinfo(guid  elementid) {     var selectquery = _session.createquery("from masterforecastinputsourcematch elementinputinfo.id = :id")                               .setparameter("id", elementid);      return selectquery.list<masterforecastinputsourcematch>(); } 

for createcriteria

public virtual iqueryable<tpersistenttype> queryablelist() {     return session.createcriteria(typeof(tpersistenttype))                   .list<tpersistenttype>().asqueryable(); } 

thanks


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -