when using SQLite database
the following configuration works perfectly on 3.0.0-preview5.19227.1
when using Add-Migration
```c#
var p = new Person() { Id = 1, Name = "Test Name",NationalID="1234" };
modelBuilder.Entity
but fails on `3.0.0-preview6.19304.10` with the following error:
```c#
System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
at lambda_method(Closure , ValueBuffer )
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalMixedEntityEntry..ctor(IStateManager stateManager, IEntityType entityType, Object entity, ValueBuffer& valueBuffer)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntryFactory.NewInternalEntityEntry(IStateManager stateManager, IEntityType entityType, Object entity, ValueBuffer& valueBuffer)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.CreateEntry(IDictionary`2 values, IEntityType entityType)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.TrackData(IModel source, IModel target)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.Diff(IModel source, IModel target, DiffContext diffContext)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationsModelDiffer.GetDifferences(IModel source, IModel target)
at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Unable to cast object of type 'System.Int32' to type 'System.String'.
@bigworld12 Please post a small, runnable project/solution or complete code listing that demonstrates the behavior you are seeing.
Possible relevant change https://github.com/aspnet/EntityFrameworkCore/commit/af9e2225cabb371932332d65afb742a867b6dfa8#diff-16c7cd39358889e6177c94b44fc5e89d
@ajcvickers it's a very minimal model consisting of only one entity (Person) connecting to a SQLite database and a single DBSet
@bigworld12 Thanks--we discussed in triage and we think we know where the issue is.
Verified that this is now fixed in the 3.0 daily builds.
Most helpful comment
@bigworld12 Thanks--we discussed in triage and we think we know where the issue is.