1

i already looking in the web for this error and i cant find any usefull. i tried to create database with entity framework in dotnet but i got this error. any suggestion what i am doing wrong? i would like to provide code but i dont know which one. i'll update it later if its necessary. now i just attach the error.

System.ArgumentNullException: Value cannot be null. Parameter name: property at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value, String parameterName) at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapper.FindMapping(IProperty property) at Microsoft.EntityFrameworkCore.Migrations.MySqlMigrationsSqlGenerationHelper.ColumnDefinition(String schema, Strin g table, String name, Type clrType, String type, Nullable1 unicode, Nullable1 maxLength, Boolean rowVersion, Boolean nullable, Object defaultValue, String defaultValueSql, String computedColumnSql, IAnnotatable annotatable, IModel model , MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.ColumnDefinition(AddColumnOperation operation, IM odel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(CreateTableOperation operation, IModel m odel, MigrationCommandListBuilder builder, Boolean terminate) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(CreateTableOperation operation, IModel m odel, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel mod el, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model ) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Value cannot be null. Parameter name: property reformat stacktrace

any response would be great. thank you very much.

2
  • as nice as the exception info is, we need code to tell you where the error is. Commented Sep 22, 2017 at 17:53
  • @Hack yeah which part of the code ? i am affraid i takes to long if i put it all in here. Commented Sep 23, 2017 at 4:02

2 Answers 2

1

Thank you guys for helping me. i now know the problem. it just typo in the table name.

public DbSet<Account> tblAccount {get;set;}

then i write this in the migration code

migrationBuilder.CreateTable(
            name: "tblAccounts ",
            columns: table => new ....

i am sorry i didn't realize it.

Sign up to request clarification or add additional context in comments.

Comments

0

You are trying to send null value for a parameter/column which is of type not null.

3 Comments

i dont even know that i am sending null value. could you give me a clue where i could start search it in the code?
I cannot hint you without the code. But you can verify the value for each properties if the list is not huge.
Thank you @Rex for the help. i can now resolve the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.