0
votes

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.Hack
@Hack yeah which part of the code ? i am affraid i takes to long if i put it all in here.Niko surya pratama

2 Answers

0
votes

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

0
votes

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.