Occasionally I was getting an exception raised:
Code: Select all
System.InvalidOperationException: 'The default DbConfiguration instance was used by the Entity Framework
before the 'PgSqlEntityProviderServicesConfiguration' type was discovered.
An instance of 'PgSqlEntityProviderServicesConfiguration' must be set at application start before using any
Entity Framework features or must be registered in the application's config file.
See http://go.microsoft.com/fwlink/?LinkId=260883 for more information.'
Code: Select all
<entityFramework codeConfigurationType="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServicesConfiguration, Devart.Data.PostgreSql.Entity">
Alternatively, this could have been solve also by adding the DbConfigurationType attribute on the DbContext
Code: Select all
using Devart.Data.PostgreSql.Entity;
namespace IdentityServer3.EntityFramework
{
[DbConfigurationType(typeof(PgSqlEntityProviderServicesConfiguration))]
public class BaseDbContext : DbContext
...