This project is read-only.

Creating Multiple items and add them to an items list.

Nov 21, 2012 at 8:44 PM

Maybe I've been out in the sun too long but I just cannot find the solution I am looking for.

(I am on nHydrate 4.1.210)

I have an entity call it [House] and I have a series of [notes] I want to add to that house.

In EF I would expect that I could go;

Dim n as new Notes()

'Fill the note (less the auto-id)

_context.addItem(n)

Dim n as new Notes()

'Fill the note (less the auto-id)

_context.addItem(n)

Alas, I cannot do this.  When I then attempt to save the changes with _context.SaveChanges() the code crashes because the created Notes have the Same Identifier.

What up wid dat?

Steve

Nov 21, 2012 at 10:50 PM

Fixed,

I was using an associative table without setting it as associative in the model, this table obviously had a composite-key not an identity one.  Setting the table as associative and re-generating my efdal fixed my stupidity.

 

Thanks,

Steve