quangdd5757 / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

allPropertiesExceptKey.Count() and ElementAt() is calling IsWritaeable too many times #88

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Do a simple insert operation user dapper contrib
2. Put the debugger on insert
3. In the code file SqlMapperExtension.cs the code 
allPropertiesExceptKey.Count() or allPropertiesExceptKey.ElementAt() calls 
IsWriteable for all the properties of the POCO, this is definitely a 
performance hit also while debugging we have to step over in such code instead 
of stepping into it.

What is the expected output? What do you see instead?
At least make put the count value in a variable so that the iteration does not 
happen everytime the count() get called. Furthermore if the elementAt also can 
be optimized it would be great.

What version of the product are you using? On what operating system?
Dapper 1.8 on Windows 7

Please provide any additional information below.
I just started using Dapper, hence I am not able to suggest something concrete 
now (my mini ORM is hosted on xmldatamapper.codeplex.com). I will try and 
provide more inputs and contribution later, keep up the good work guys!

Original issue reported on code.google.com by bin...@gmail.com on 15 Mar 2012 at 8:15