IdentityServer / IdentityServer3.EntityFramework

EntityFramework persistence layer for IdentityServer3
Apache License 2.0
68 stars 97 forks source link

EF Performance - As No Tracking #126

Open wjonesy opened 7 years ago

wjonesy commented 7 years ago

Hello,

I have had a look through the code base and I have found that when we read data from the database, there is no need for EF's change tracking, as no manipulation is done to the data being read. I.E. SaveChanges() is not being called after a read.

To improve performance, each query could be decorated with .AsNoTracking(), turning off EF's ability to track changes in the context.

If this is deemed to be a useful change I am happy to give a pull request a go.

Thanks

brockallen commented 7 years ago

Would it introduce any breaking or behavior changes that would be deemed breaking?

wjonesy commented 7 years ago

Not that I can see so far.