Answer the question
In order to leave comments, you need to log in
Problem in C# code "does not contain a definition of UseSqlServer and could not find an available extension method" how to solve it?
What needs to be connected is not clear
public class AppDBContent : DbContext
{
public AppDBContent(DbContextOptions<AppDBContent> options) : base(options)
{
}
public Microsoft.EntityFrameworkCore.DbSet<Realty> Realty { get; set; }
public Microsoft.EntityFrameworkCore.DbSet<Category> Category { get; set; }
}
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<AppDBContent>(options => options.UseSqlServer(_confSting.GetConnectionString("DefaultConnection")));
services.AddTransient<IAllRealty, MockRealty>();
services.AddTransient<IRealtyCategory, MockCategory>();
services.AddControllersWithViews();
services.AddMvc();
}
Answer the question
In order to leave comments, you need to log in
Open the NuGet Package Manager. Remove all existing packages related to Entity Framework and SQL.
Then install only one Microsoft.EntityFraneworkCore.SqlServer package.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question