Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JonathanMagnan/d695010082d80e9c5c9fd670f8e2f485 to your computer and use it in GitHub Desktop.
Save JonathanMagnan/d695010082d80e9c5c9fd670f8e2f485 to your computer and use it in GitHub Desktop.
<appSettings>
<add key="Z_EntityFramework_Extensions_LicenseName" value="[licenseName]"/>
<add key="Z_EntityFramework_Extensions_LicenseKey" value="[licenseKey]"/>
</appSettings>
string licenseName = //... PRO license name
string licenseKey = //... PRO license key
Z.EntityFramework.Extensions.LicenseManager.AddLicense("[LicenseName]", "[LicenseKey]");
// CHECK for default provider (SQL Server)
if(!Z.EntityFramework.Extensions.LicenseManager.ValidateLicense())
{
throw new Exception("Invalid License!");
}
// CHECK for a specific provider
if (!Z.EntityFramework.Extensions.LicenseManager.ValidateLicense(ProviderType.MySql))
{
throw new Exception("Invalid License!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment