Quantcast
Channel: Everything SQL Server Compact
Viewing all articles
Browse latest Browse all 160

SQL Server Compact Code Snippet of the Week #16 : detect Entity Framework database type

$
0
0

This weeks code snippet is prompted by a StackOverflow question, regarding how to detect if the database that was backing an Entity Framework DbContext was SQL Server Compact.

My proposed check simply uses the "is" operator to determine if the Database.Connection property is compatible with the SqlCeConnection class.

so my check is:

context.Database.Connection is SqlCeConnection

Viewing all articles
Browse latest Browse all 160

Trending Articles