I've added a item into the context model and tried to save the changes, but even with valid values I'm getting error like below. Wonder how come it throws even after having all the valid values.
System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details.
Oracle.ManagedDataAccess.Client.OracleException: ORA-01400: cannot insert NULL into ("DBO"."JOBS"."JOBID")
Code:
_dbContext.Jobs.Add(new Job(){JobId = 1902456,JobExecutionId = 390023,AccountId = 1,CommandType = "Type 1"});
_dbContext.SaveChanges();
internal class JobsConfiguration : EntityTypeConfiguration<Job>
{
public JobsConfiguration()
{
ToTable("JOBS");
HasKey(g => g.JobId);
Property(g => g.JobId).HasColumnName("JOBID");
Property(g => g.JobExecutionId).HasColumnName("JOBEXECUTION_ID");
Property(g => g.AccountId).HasColumnName("ACCTID");
Property(g => g.CommandType).HasColumnName("COMMANDTYPE");
}
}