I have ConsoleApplication on .NET Core and also i added my DbContext to dependencies, but howewer i have an error:
Unable to create an object of type \'My
The quick solution to the problem is to implement the default constructor in your context
public MyContext() : base()
{
}
The problem with this solution is that you will have to enter the connection string in the 'OnConfiguring' function explicitly, which is not recommended
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlite("ConnectionString");
}
}