Feb 25, 2011 at 1:30 PM
Edited Feb 25, 2011 at 1:33 PM
I have created a NotNull column on a content part:
SchemaBuilder.CreateTable("CategoryPartRecord", table => table
.Column<string>("Name", column => column.NotNull()));
However, when I try to create a new record for this part with non-empty Name, I am getting a database exception "cannot insert NULL value in column Name". To make sure it is not connected with my other code, I have removed NotNull specification from this
part and recreated the database -- now records are inserted successfully and name is stored OK.
I looked through the existing modules, and it seems that nobody is using NOT NULL columns in tables.
Am I doing something wrong? Or does it mean that we should not use NotNull() for string columns for some reason?