loresoft / EntityFrameworkCore.Generator

Generate Entity Framework Core model from an existing database

Home Page:https://efg.loresoft.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sqlite Error due to schema null

vinod-vetrivel opened this issue · comments

When I try to generate code for an SQLite database, the process terminates at the model generation of first table. As the schema is null, the regex fails in the ToLegalName function. Below is the part of the log where it fails.

19:56:43 I Loaded database model for: data
19:56:43 I Building code generation model from database: data
19:56:43 D   Processing Table : null.Logs
19:56:43 F Host terminated unexpectedly
System.ArgumentNullException: Value cannot be null. (Parameter 'input')
   at System.Text.RegularExpressions.Regex.IsMatch(String input)
   at System.Text.RegularExpressions.Regex.IsMatch(String input, String pattern)
   at EntityFrameworkCore.Generator.ModelGenerator.ToLegalName(String name) in C:\projects\entityframeworkcore-generator\src\EntityFrameworkCore.Generator.Core\ModelGenerator.cs:line 603
   at EntityFrameworkCore.Generator.ModelGenerator.Generate(GeneratorOptions options, DatabaseModel databaseModel, IRelationalTypeMappingSource typeMappingSource) in C:\projects\entityframeworkcore-generator\src\EntityFrameworkCore.Generator.Core\ModelGenerator.cs:line 75
   at EntityFrameworkCore.Generator.CodeGenerator.Generate(GeneratorOptions options) in C:\projects\entityframeworkcore-generator\src\EntityFrameworkCore.Generator.Core\CodeGenerator.cs:line 47
   at EntityFrameworkCore.Generator.GenerateCommand.OnExecute(CommandLineApplication application) in C:\projects\entityframeworkcore-generator\src\EntityFrameworkCore.Generator\GenerateCommand.cs:line 76
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at EntityFrameworkCore.Generator.Program.Main(String[] args) in C:\projects\entityframeworkcore-generator\src\EntityFrameworkCore.Generator\Program.cs:line 50

resolved in version 3.1.0.331