Last active
March 24, 2022 14:47
-
-
Save Guifgr/de6d947877a448216efefa92bc023bc2 to your computer and use it in GitHub Desktop.
Verify database connection entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
using var dbContext = new Context(); | |
Console.WriteLine($"Connected {dbContext.Database.CanConnectAsync().Result}"); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine($"Error {e.Message}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment