Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete preview DbContext splitting #2616

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions src/Core/RevEng.Core.60/ReverseEngineerRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public static ReverseEngineerResult GenerateFiles(ReverseEngineerCommandOptions
: PathHelper.GetNamespaceFromOutputPath(outputContextDir, options.ProjectPath, options.ProjectRootNamespace);
}

ValidateOptions(options, warnings);

var entityTypeConfigurationPaths = new List<string>();
SavedModelFiles procedurePaths = null;
SavedModelFiles functionPaths = null;
Expand Down Expand Up @@ -193,23 +195,6 @@ public static ReverseEngineerResult GenerateFiles(ReverseEngineerCommandOptions
warnings.Add($"Your database compatibility level is only '{sku.Level}', consider updating to 130 or higher to take full advantage of new database engine features.");
}

if (options.UseDatabaseNames && options.CustomReplacers?.Count > 0)
{
warnings.Add($"'use-database-names' / 'UseDatabaseNames' has been set to true, but a '{Constants.RenamingFileName}' file was also found. This prevents '{Constants.RenamingFileName}' from functioning.");
}

if (options.UseT4 && options.UseT4Split)
{
warnings.Add("Both UseT4 and UseT4Split are set to true. Only one of thse should be used, UseT4Split will be ignored.");
options.UseT4Split = false;
}

if (options.UseT4Split && options.UseDbContextSplitting)
{
warnings.Add("Both UseDbContextSplitting and UseT4Split are set to true. Only one of thse should be used, UseT4Split will be ignored.");
options.UseT4Split = false;
}

var result = new ReverseEngineerResult
{
EntityErrors = errors,
Expand Down Expand Up @@ -305,6 +290,32 @@ public static void RetryFileWrite(string path, string finalText)
}
#endif

private static void ValidateOptions(ReverseEngineerCommandOptions options, List<string> warnings)
{
if (options.UseDatabaseNames && options.CustomReplacers?.Count > 0)
{
warnings.Add($"'use-database-names' / 'UseDatabaseNames' has been set to true, but a '{Constants.RenamingFileName}' file was also found. This prevents '{Constants.RenamingFileName}' from functioning.");
}

if (options.UseT4 && options.UseT4Split)
{
warnings.Add("Both UseT4 and UseT4Split are set to true. Only one of these should be used, UseT4Split will be used.");
options.UseT4 = false;
}

if (options.UseDbContextSplitting)
{
warnings.Add("UseDbContextSplitting (preview) is obsolete, please switch to the T4 split DbContext template.");
options.UseDbContextSplitting = false;
}

if (options.UseT4Split && options.UseDbContextSplitting)
ErikEJ marked this conversation as resolved.
Show resolved Hide resolved
{
warnings.Add("Both UseDbContextSplitting (preview) and UseT4Split are set to true. Only one of these should be used, UseT4Split will be used.");
options.UseDbContextSplitting = false;
}
}

private static SavedModelFiles CreateCleanupPaths(SavedModelFiles procedurePaths, SavedModelFiles functionPaths, SavedModelFiles filePaths)
{
var cleanUpPaths = new SavedModelFiles(filePaths.ContextFile, filePaths.AdditionalFiles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Vyhledávání objektů</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Rozdělit DbContext do konfiguračních tříd (preview)</value>
<value>Rozdělit DbContext do konfiguračních tříd (obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Improve your SQLite experience</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Objekte suchen</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>DbContext in Konfigurationsklassen aufteilen (Vorschau)</value>
<value>DbContext in Konfigurationsklassen aufteilen (Obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>SQLite Experience verbessern</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Search for objects</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Split DbContext into Configuration classes (preview)</value>
<value>Split DbContext into Configuration classes (Obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Improve your SQLite experience</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Buscar objetos</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Dividir DbContext en clases de configuración (vista previa)</value>
<value>Dividir DbContext en clases de configuración (obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Mejore su experiencia SQLite</value>
Expand Down
173 changes: 58 additions & 115 deletions src/GUI/EFCorePowerTools/Locales/ReverseEngineerLocale.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,15 @@
<data name="AddAdhocDatabaseConnection" xml:space="preserve">
<value>Ajouter une connexion personnalisée</value>
</data>
<data name="AddAdhocDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion définie manuellement</value>
</data>
<data name="AddDatabaseConnection" xml:space="preserve">
<value>Ajouter une connexion de base de données</value>
</data>
<data name="AddDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion Explorateur de serveur (DDEX)</value>
</data>
<data name="AddExternalDacPac" xml:space="preserve">
<value>Ajouter un fichier .dacpac</value>
</data>
Expand Down Expand Up @@ -168,6 +174,9 @@
<data name="ChooseSqlServerDatabaseProject" xml:space="preserve">
<value>Choisissez votre projet de base de données SQL Server</value>
</data>
<data name="CodeGeneration" xml:space="preserve">
<value>Génération de code</value>
</data>
<data name="ConnectionName" xml:space="preserve">
<value>Nom</value>
</data>
Expand Down Expand Up @@ -198,6 +207,12 @@
<data name="DbContextSubNamespace" xml:space="preserve">
<value>Sous espace de noms du DbContext (remplace le chemin) - facultatif</value>
</data>
<data name="DDEXProviderExperience" xml:space="preserve">
<value>Installer le fournisseur DDEX pour un meilleure expérience</value>
</data>
<data name="EFCoreVersionTip" xml:space="preserve">
<value>Choisissez votre version d'EF Core</value>
</data>
<data name="EntityTypesAndContext" xml:space="preserve">
<value>EntityTypes et DbContext</value>
</data>
Expand All @@ -210,6 +225,9 @@
<data name="EntityTypesSubNamespace" xml:space="preserve">
<value>Sous espace de noms pour les EntityTypes (remplace le chemin) - facultatif</value>
</data>
<data name="FileLayout" xml:space="preserve">
<value>Layout du fichier</value>
</data>
<data name="FilterSchemas" xml:space="preserve">
<value>Filtrer les schemas</value>
</data>
Expand All @@ -225,6 +243,9 @@
<data name="GettingReadyToConnect" xml:space="preserve">
<value>Préparation à la connexion...</value>
</data>
<data name="Help" xml:space="preserve">
<value>Aide</value>
</data>
<data name="IncludeConnectionStringGeneratedCode" xml:space="preserve">
<value>Inclure la chaîne de connexion dans le code généré</value>
</data>
Expand All @@ -240,9 +261,15 @@
<data name="LoadingOptions" xml:space="preserve">
<value>Chargement des options...</value>
</data>
<data name="MapHierarchyId" xml:space="preserve">
<value>Mapper les types hierarchyid</value>
</data>
<data name="MapNodaTimeTypes" xml:space="preserve">
<value>Mettre en correspondance les types de Noda Time </value>
</data>
<data name="Mapping" xml:space="preserve">
<value>Mapping</value>
</data>
<data name="MapSpatialTypes" xml:space="preserve">
<value>Mettre en correspondance les types spatiales</value>
</data>
Expand Down Expand Up @@ -270,12 +297,24 @@
<data name="PluralizeSingularizeObjectNames" xml:space="preserve">
<value>Pluraliser ou singulariser les noms d'objets générés (anglais)</value>
</data>
<data name="POCOEntities" xml:space="preserve">
<value>Entités POCO</value>
</data>
<data name="Rate" xml:space="preserve">
<value>* Noter</value>
</data>
<data name="RateTip" xml:space="preserve">
<value>Dites-moi si vous aimez cet outil gratuit</value>
</data>
<data name="ReleaseNotes" xml:space="preserve">
<value>Notes de version</value>
</data>
<data name="RemoveConstructorFromEntities" xml:space="preserve">
<value>Supprimer le constructeur des classes d'entités (expérimental)</value>
</data>
<data name="RemoveDefaultConstructor" xml:space="preserve">
<value>Supprimer le constructeur par défaut du DbContext</value>
</data>
<data name="RemoveNavigationsFromEntities" xml:space="preserve">
<value>Supprimer les propriétés de navigation des classes d'entités (expérimental)</value>
</data>
Expand All @@ -285,6 +324,9 @@
<data name="RemoveSQLDefaultFromBoolColumns" xml:space="preserve">
<value>Supprimer la valeur SQL par défaut des colonnes booléennes</value>
</data>
<data name="RenamingNavigations" xml:space="preserve">
<value>Renommage des propriétés de navigation</value>
</data>
<data name="ReportingResult" xml:space="preserve">
<value>Communication des résultats...</value>
</data>
Expand All @@ -298,7 +340,10 @@
<value>Rechercher des objets</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Séparer le DbContext en classes de configuration (préliminaire)</value>
<value>Séparer le DbContext en classes de configuration (obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Améliorer l'expérience SQLite</value>
</data>
<data name="SqlServerNoViewDefinitionRights" xml:space="preserve">
<value>Les informations d'identification utilisées n'ont pas reçu les droits « VIEW DEFINITION », la fonctionnalité peut donc être dégradée ou défectueuse.</value>
Expand All @@ -312,6 +357,9 @@
<data name="StoredProceduresReturnList" xml:space="preserve">
<value>Procédures stockées retourne List (tableau par défaut)</value>
</data>
<data name="T4TemplatePath" xml:space="preserve">
<value>Chemin du template T4 - optionnel</value>
</data>
<data name="Tables" xml:space="preserve">
<value>Tables</value>
</data>
Expand Down Expand Up @@ -342,6 +390,9 @@
<data name="UseEF6Pluralizer" xml:space="preserve">
<value>Utiliser le pluraliseur EF6 classique</value>
</data>
<data name="UseManyToManyEntity" xml:space="preserve">
<value>Utiliser les entités many to many</value>
</data>
<data name="UseNamesFromDatabase" xml:space="preserve">
<value>Utilisez les noms de table et de colonne directement à partir de la base de données</value>
</data>
Expand All @@ -351,9 +402,15 @@
<data name="UseRegularExpression" xml:space="preserve">
<value>Utiliser une expression régulière</value>
</data>
<data name="UserGuide" xml:space="preserve">
<value>Guide utilisateur</value>
</data>
<data name="UseSchemaFolders" xml:space="preserve">
<value>Utiliser la séparation des dossiers par schéma (expérimental)</value>
</data>
<data name="UseSchemaNamespaces" xml:space="preserve">
<value>Utiliser la séparation des espaces de noms de schéma (expérimental)</value>
</data>
<data name="UseTextSearch" xml:space="preserve">
<value>Utiliser la recherche textuelle</value>
</data>
Expand All @@ -363,118 +420,4 @@
<data name="WhatToGenerate" xml:space="preserve">
<value>Quoi générer</value>
</data>
<data name="AddAdhocDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion définie manuellement</value>
</data>
<data name="AddDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion à l'explorateur de serveur (DDEX)</value>
</data>
<data name="CodeGeneration" xml:space="preserve">
<value>Génération de code</value>
</data>
<data name="DDEXProviderExperience" xml:space="preserve">
<value>Installez le fournisseur DDEX pour une meilleure expérience</value>
</data>
<data name="EFCoreVersionTip" xml:space="preserve">
<value>Choisissez votre version de EF Core</value>
</data>
<data name="FileLayout" xml:space="preserve">
<value>Disposition du fichier</value>
</data>
<data name="Help" xml:space="preserve">
<value>Aide</value>
</data>
<data name="MapHierarchyId" xml:space="preserve">
<value>Mettre en correspondance le HierarchyId</value>
</data>
<data name="Mapping" xml:space="preserve">
<value>Correspondance</value>
</data>
<data name="POCOEntities" xml:space="preserve">
<value>Entités POCO</value>
</data>
<data name="Rate" xml:space="preserve">
<value>⭐ Évaluez</value>
</data>
<data name="RateTip" xml:space="preserve">
<value>Faites-moi savoir si vous aimez cet outil gratuit</value>
</data>
<data name="RemoveDefaultConstructor" xml:space="preserve">
<value>Supprimer le constructeur par défaut du DbContext</value>
</data>
<data name="RenamingNavigations" xml:space="preserve">
<value>Renommage des navigations</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Améliorez votre expérience de SQLite</value>
</data>
<data name="T4TemplatePath" xml:space="preserve">
<value>Chemin du modèle T4 - facultatif</value>
</data>
<data name="UseManyToManyEntity" xml:space="preserve">
<value>Utiliser les entités plusieurs à plusieurs</value>
</data>
<data name="UserGuide" xml:space="preserve">
<value>Guide de l'utilisateur</value>
</data>
<data name="UseSchemaNamespaces" xml:space="preserve">
<value>Utiliser la séparation des dossiers par l'espace de nom des schémas (expérimental)</value>
</data>
<data name="AddAdhocDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion définie manuellement</value>
</data>
<data name="AddDatabaseConnectionTip" xml:space="preserve">
<value>Ajouter une connexion Explorateur de serveur (DDEX)</value>
</data>
<data name="CodeGeneration" xml:space="preserve">
<value>Génération de code</value>
</data>
<data name="DDEXProviderExperience" xml:space="preserve">
<value>Installer le fournisseur DDEX pour un meilleure expérience</value>
</data>
<data name="EFCoreVersionTip" xml:space="preserve">
<value>Choisissez votre version d'EF Core</value>
</data>
<data name="FileLayout" xml:space="preserve">
<value>Layout du fichier</value>
</data>
<data name="Help" xml:space="preserve">
<value>Aide</value>
</data>
<data name="MapHierarchyId" xml:space="preserve">
<value>Mapper les types hierarchyid</value>
</data>
<data name="Mapping" xml:space="preserve">
<value>Mapping</value>
</data>
<data name="POCOEntities" xml:space="preserve">
<value>Entités POCO</value>
</data>
<data name="Rate" xml:space="preserve">
<value>* Noter</value>
</data>
<data name="RateTip" xml:space="preserve">
<value>Dites-moi si vous aimez cet outil gratuit</value>
</data>
<data name="RemoveDefaultConstructor" xml:space="preserve">
<value>Supprimer le constructeur par défaut du DbContext</value>
</data>
<data name="RenamingNavigations" xml:space="preserve">
<value>Renommage des propriétés de navigation</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Améliorer l'expérience SQLite</value>
</data>
<data name="T4TemplatePath" xml:space="preserve">
<value>Chemin du template T4 - optionnel</value>
</data>
<data name="UseManyToManyEntity" xml:space="preserve">
<value>Utiliser les entités many to many</value>
</data>
<data name="UserGuide" xml:space="preserve">
<value>Guide utilisateur</value>
</data>
<data name="UseSchemaNamespaces" xml:space="preserve">
<value>Utiliser la séparation des espaces de noms de schéma (expérimental)</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Szukaj obiektów</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Podziel DbContext na klasy konfiguracji (wersja zapoznawcza)</value>
<value>Podziel DbContext na klasy konfiguracji (obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Popraw swoje doświadczenie z SQLite</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<value>Procurar objetos</value>
</data>
<data name="SplitDbContextIntoConfigurationClasses" xml:space="preserve">
<value>Dividir DbContext em classes de configuração (visualização)</value>
<value>Dividir DbContext em classes de configuração (obsolete)</value>
</data>
<data name="SQLiteExperience" xml:space="preserve">
<value>Melhore sua experiência SQLite</value>
Expand Down
Loading