I'm using a new .Net 8, and I'm trying to inject some service with a new way of keyed services, but unfortunately i cannot find FromKeyedServices
, is not found, it's belong to Microsoft.Extensions.DependencyInjection
namespace, i added this but still i don't see it.
using Microsoft.Extensions.DependencyInjection;
namespace SMSService.Persistence.ContextFactories
{
public class ApplicationDbContextFactory<TDbContext>
{
private readonly IConfiguration _configuration;
private readonly DbContextOptionsBuilder<TDbContext> _optionsBuilder;
public ApplicationDbContextFactory(
IConfiguration configuration, [FromKeyedServices("Sql")] IDbContextOptionBuilder dbContextOptionBuilder , ILogger<ApplicationDbContextFactory<TDbContext>> logger)
{
Can anyone help me