سلام
من میخام بجای adddbcontext از AddDbContextPool استفاده کنم . اما ارور زیر رو دارم . ممنون میشم راهنمایی کنید .
DataContext :
public class DataContext : IdentityDbContext<User> {
public DataContext(DbContextOptions options) : base(options)
{
}
public DataContext()
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.Entity<User>().ToTable("Users");
}
}
startup :
services.AddDbContextPool<DataContext>(options =>
options.UseSqlServer(connection)));
ارور :
InvalidOperationException: The DbContext of type 'DataContext' cannot be pooled because it does not have a single public constructor accepting a single parameter of type DbContextOptions.