Solve my problem using this line of code in my Startup.cs file.
Adding a transient service means that each time the service is requested, a new instance is created when you are working
with
Dependency injection
services.AddDbContext<Context>(options =>
options.UseSqlServer(_configuration.GetConnectionString("ContextConn")),
ServiceLifetime.Transient);