Object Null Ref when save changes adding new entity
Posted: Mon 11 Jul 2016 07:14
Object reference not set to an instance of an object
Reproduce step:
Devart.Data.MySql.Entity.EFCore.dll, 8.6.687.0
net451, dotnet core 1.0.0-RTM
_dbcontext.Registrations.Add(new ABC{
Name = "abc",
// Username = ?, Not null column, but not define required
});
_dbcontext.SaveChanges();
Expected: MySQL error message
Actual: Object reference not set to an instance of an object
Code: Select all
at Devart.Common.Entity.ak.l()
at Microsoft.EntityFrameworkCore.Storage.RelationalLoggerExtensions.LogCommandExecuted(ISensitiveDataLogger logger, DbCommand command, Int64 startTimestamp, Int64 currentTimestamp)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean openConnection, Boolean closeConnection)
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues, Boolean manageConnection)
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
Devart.Data.MySql.Entity.EFCore.dll, 8.6.687.0
net451, dotnet core 1.0.0-RTM
_dbcontext.Registrations.Add(new ABC{
Name = "abc",
// Username = ?, Not null column, but not define required
});
_dbcontext.SaveChanges();
Expected: MySQL error message
Actual: Object reference not set to an instance of an object