linq - Fastest way to get a single record with SubSonic -


I'm new to SubSonic and Linq Stuff and I'm trying to find the smallest and most optimal way to retrieve a single record.

User user2 = DB.Select (). From (User.Schema)

). Where (user.password column). IS aquilo (password). And. (User assimer column). IEEqualto (SINM). Exotic Sling Lit; User & gt; ();

I have used the antipspriller tool to check, and it is 29.12 mm. The average CPU seems to be - tested more than ten runs

where it takes more time

  UserController uc = New UserController (); Query query = new query ("user"); Query WHERE (User.Columns.Password, password); Query WHERE (User Columns. SNumber, CINM); User user = uc.FetchByQuery (query). First & lt; Users & gt; ();  

Simply takes the last line 256.08ms CPU Time Plus UserController 66.86ms.

Any suggestions?

IIRC, the query object is fluent .. i.e.

  query. WHERE (User.Columns.Password, password); Query WHERE (User Columns. SNumber, CINM);  

should read as:

  query = query. WHERE (User.Columns.Password, password); Query = query WHERE (User Columns. SNumber, CINM);  

Your tests can be calculated due to the extended period (you are asking for all the user items and then taking the first).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -