jdtcn / runtimeefcore Goto Github PK
View Code? Open in Web Editor NEWRoslyn & Ef core: create DbContext in runtime
License: MIT License
Roslyn & Ef core: create DbContext in runtime
License: MIT License
Необработанное исключение при попытке запустить ваш демо проект под PostgreSQL
static IReverseEngineerScaffolder CreatePostgreScaffolder() =>
new ServiceCollection()
.AddEntityFrameworkSqlServer()
.AddLogging()
.AddEntityFrameworkDesignTimeServices()
.AddSingleton<LoggingDefinitions, NpgsqlLoggingDefinitions>()
.AddSingleton<IRelationalTypeMappingSource, NpgsqlTypeMappingSource>()
.AddSingleton<IAnnotationCodeGenerator, AnnotationCodeGenerator>()
.AddSingleton<IDatabaseModelFactory, NpgsqlDatabaseModelFactory>()
.AddSingleton<IProviderConfigurationCodeGenerator, NpgsqlCodeGenerator>()
.AddSingleton<IScaffoldingModelFactory, RelationalScaffoldingModelFactory>()
.AddSingleton<IPluralizer, Bricelam.EntityFrameworkCore.Design.Pluralizer>()
.AddSingleton<ProviderCodeGeneratorDependencies>()
.AddSingleton<AnnotationCodeGeneratorDependencies>()
.BuildServiceProvider()
.GetRequiredService<IReverseEngineerScaffolder>();
Приложение компилируется без ошибок, но при попытке вызова
var scaffolder = CreatePostgreScaffolder();
падает исключение:
System.InvalidOperationException: Unable to resolve service for type 'Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.INpgsqlSingletonOptions' while attempting to activate 'Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlTypeMappingSource'.
Не очень понимаю что нужно сделать, демо с Microsoft SQL Server стартует корректно.
Can i rebuild/modify class definition in runtime without restart webapp?
Hi
I upgraded project to .Net 7 and then the references to the latest versions. after upgrading the code can not compile because of some errors and visual studio said you are missing some references. but when I downgrade the reference of microsoft.entityframeworkcore.design compile is successful but the program doesn't work correctly because of differences between versions.
Could you upgrade it to latest versions?
Thanks
Mohsen
Слушай а такой вопрос !
А были задача генерировать сначала модель а потом код и скрипты миграции ?
Этот самый IDatabaseModelFactory ?
Если делать не реверс а строить сначала модель а потом выполнять миграции ?
Подходит ли IDatabaseModelFactory?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.