Hi,
I'm trying to run your code but met a problem on creating the database schema through using code-first approach as fellowing:
PM> add-migration MicrosofteShopOnWebCatalogDbContext -context MicrosofteShopOnWebCatalogDbContext
To undo this action, use Remove-Migration.
PM> update-database -context MicrosofteShopOnWebCatalogDbContext
System.ArgumentException: GenericArguments[0], 'DotnetCrawler.Data.Migrations.MicrosofteShopOnWebCatalogDbContext', on 'Microsoft.EntityFrameworkCore.Design.IDesignTimeDbContextFactory1[TContext]' violates the constraint of type 'TContext'. ---> System.TypeLoadException: GenericArguments[0], 'DotnetCrawler.Data.Migrations.MicrosofteShopOnWebCatalogDbContext', on 'Microsoft.EntityFrameworkCore.Design.IDesignTimeDbContextFactory
1[TContext]' violates the constraint of type parameter 'TContext'.
at System.RuntimeTypeHandle.Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, Int32 numGenericArgs, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.Instantiate(Type[] inst)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
--- End of inner exception stack trace ---
at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
at System.RuntimeType.MakeGenericType(Type[] instantiation)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextFactory(Type contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextTypes()
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextType(String name)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
GenericArguments[0], 'DotnetCrawler.Data.Migrations.MicrosofteShopOnWebCatalogDbContext', on 'Microsoft.EntityFrameworkCore.Design.IDesignTimeDbContextFactory`1[TContext]' violates the constraint of type 'TContext'.