I have the following Entity Framework model:

It's a very simple model and was working fine when Entity Framework was generating the SQL. When I mapped the entities to stored procedures I get the following error when trying to create a LogEntry:
Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints, model requirements, or store-generated values.
The code I am using to make a LogEntry looks like the following:
le.DateAndTime = DateTime.Now;
le.User = (Guid)Membership.GetUser().ProviderUserKey;
Log log = lr.GetLog(le.LogId);
log.LogEntries.Add(le);
lr.Save(); // lr is an instance of LogsRepository, defined earlier in the class
The exception isn't thrown until lr.Save() is called.
Can anybody help me decipher this? I have stored procedures which all work on their own, independent of entity framework, mapped to the entities.
