How to pass connection string in .net core 7
var connectionString = builder.Configuration.GetConnectionString("HotelListingConnection"); builder.Services.AddDbContext<HotelDbContext>(options => { options.UseSqlServer(connectionString); });
i'm getting error:
The type 'HotelDbContext' cannot be used as type parameter 'TContext' in the generic type or method 'EntityFrameworkServiceCollectionExtensions.AddDbContext<TContext>(IServiceCollection, Action<DbContextOptionsBuilder>?, ServiceLifetime, ServiceLifetime)'. There is no implicit reference conversion