Bom dia,
Como consigo permitir que seja inserido valores NULL nas colunas, estou exportando o json do ad-user e existe alguns campos nulos.
Erro:
Microsoft.EntityFrameworkCore.DbUpdateException
HResult=0x80131500
Message=An error occurred while updating the entries. See the inner exception for details.
Source=Microsoft.EntityFrameworkCore.Relational
StackTrace:
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext _, ValueTuple`2 parameters)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
at Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IReadOnlyList`1 entries)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
at MizuAgenda_Core.Repositories.ContatoRepository.SaveContatos(List`1 dadoscontatos) in C:\Users\thiagogriao\source\repos\MizuAgenda_Core_Novo\MizuAgenda_Core\Repositories\ContatoRepository.cs:line 43
at MizuAgenda_Core.DataService.InicializaDB() in C:\Users\thiagogriao\source\repos\MizuAgenda_Core_Novo\MizuAgenda_Core\DataService.cs:line 28
at MizuAgenda_Core.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider) in C:\Users\thiagogriao\source\repos\MizuAgenda_Core_Novo\MizuAgenda_Core\Startup.cs:line 74
Exceção interna 1:
SqlException: Não é possível inserir o valor NULL na coluna 'Ramal', tabela 'AGENDA.dbo.Contato'; a coluna não permite nulos. Falha em INSERT.
A instrução foi finalizada.