I'll tackle this somewhat differently in my response and attempt to explain what needs to be altered in order to provide a useful example;
Unique IDs must not be nullable, as someone has already said, therefore the
ought to a
. Additionally, you must modify the Id column in
These could need a blank constructor only to generate a new Guid.
The second thing is the foreign key in your other item.
is OK, this can remain, but you'll need to alter your setup if it does.
You have said that the property is necessary in this block.
modelBuilder.Domain<DomainType>() .HasMany(p => p.DomainCustomFields) .WithRequired() .HasForeignKey<Guid?>(x => x.DomainTypeId);
Make it optional, please;
modelBuilder.Domain<DomainType>() .HasMany(p => p.DomainCustomFields) .WithOptional() .HasForeignKey<Guid?>(x => x.DomainTypeId);
That ought to put your problems to rest. Please ask me any questions.