سؤال

I am trying to get any DB queries that happen when using the SqlMembershipProvider to show in MiniProfiler but I can't think of any way to swap out the SqlConnection is uses with a ProfiledDbConnection as it seems to do everything internally. Anyone have any ingenious ideas?

هل كانت مفيدة؟

المحلول

You could download the source (freely avaliable) for the ASP.Net SQL Providers here, read more about it here, Scott Gu published tons of whitepapers in this article about the provider model. internal to the assembly is a SQLConnectionHelper that you can update to use the ProfiledDBConnection instead. This would give profiling to all the providers using that class, all thats left is to change your .config file to use the new provider instead.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top